access to http headers within services code

Asked by Mr T on 2013-07-02

Hi,
We've been developing some web services in python.

Right now we're using spyne. But we are thinking on moving to ladon, because it can use python types as input/outputs.
(we are intending to use a software call taverna as the client GUI for accessing the web services and the interaction is clearer with simple types)

We are using the HTTP headers to get the name of the user (we provide the web services using HTTP Basic Auth). Spyne let us use a "context" variable, that holds all the HTTP headers when a call is made. Is there any way we can access them using Ladon????

Question information

Language:
English Edit question
Status:
Solved
For:
ladon Edit question
Assignee:
No assignee Edit question
Solved by:
jsgaarde
Solved:
2013-07-08
Last query:
2013-07-08
Last reply:
2013-07-06
Best jsgaarde (jakob-simon-gaarde) said : #1

Hi Mr T.

Of course you can access the headers. In fact you can access all WSGI variables for every request. see here:
http://pythonhosted.org/ladon/ladonize.html#access-wsgi-environ-from-service-methods

Best regards Jakob Simon-Gaarde

Mr T (mrjaspe) said : #2

Thanks jsgaarde, that solved my question.