access to http headers within services code

Asked by Mr T

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:
Last query:
Last reply:
Revision history for this message
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

Revision history for this message
Mr T (mrjaspe) said :
#2

Thanks jsgaarde, that solved my question.