Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access Google Cloud Endpoints request header in Python and Java

In the endpoints method, how to access request header information?

like image 683
sam Avatar asked Aug 11 '26 09:08

sam


1 Answers

Python:

In the endpoint method, self.request_state.headers provides this information.

E.g., self.request_state.headers.get('authorization')

Java: Add an HttpServletRequest (req) parameter to your endpoint method. The headers are accessible through the method getHeader() e.g., req.getHeader("Authorization") See this question

like image 55
sam Avatar answered Aug 14 '26 10:08

sam