w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Sending HTTPS requests in Google App Engine using requests python library

I have no experience of using the requests library, but it may be that it is not fully implemented on App Engine.

The preferred method on App Engine is to use urlfetch

from google.appengine.api import urlfetch

url = "https://www.googleapis.com/language/translate/v2/detect"

payload = {"key":translate_api_key, "q":str(sentence)}

result = urlfetch.fetch(url=url, payload=payload)
if result.status_code == 200:
  api_response = result.content




© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.