There is an API that requires the following request header:
Accept: application/json
And on the website, it says it uses REST protocol and GET HTTP method. I'm currently using Google App Engine (with Python) and trying to make a simple form where user types in the coordinates and when they click on the submit button, it fetches the weather information. How do I add this to the header?
This is my code:
form = '''
<form method="get" action="http://some.website.fakeurl">
<label>Latitude:
<input name="lat">
</label>
<label>Longitude:
<input name="lon">
</label>
<input type="submit">
</form>
'''
class MainPage(webapp2.RequestHandler):
def get(self):
self.response.out.write(form)
And the desired request looks something like this:
Accept: application/json
access_token:
appKey: **************************
Get Method http://some.website.fakeurl/weather?lon=126.9658000000&lat=37.5714000000