json_key = json.load(open('service.json'))
scope = ['https://spreadsheets.google.com/feeds']
credentials = SignedJwtAssertionCredentials(json_key['client_email'], json_key['private_key'], scope)
self.gc = gspread.authorize(credentials)
self.sheet = self.gc.open('Order Database').sheet1
self.menuSheet = self.gc.open('Menu and Stocking').sheet1
return self.menuSheet.get_all_values()
HttpClient client = new DefaultHttpClient();
HttpGet request =new HttpGet(url);
request.addHeader("x-api-key",apikey);
HttpResponse response = client.execute(request);
BufferReader rd = new BufferReader(new InputStreamReader(response.getEntity().getContent()));
String line = rd.readLine();
HTTPError: 401: <HTML> <HEAD> <TITLE>Unauthorized</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>Unauthorized</H1> <H2>Error 401</H2> </BODY> </HTML>- at getMenuItems (/base/data/home/apps/s~gowcanteen/1.394247265273324301/server.py:24)
- at API_MENU (/base/data/home/apps/s~gowcanteen/1.394247265273324301/main.py:61)
- at dispatch_request (/base/data/home/apps/s~gowcanteen/1.394247265273324301/lib/flask/app.py:1461)
- at full_dispatch_request (/base/data/home/apps/s~gowcanteen/1.394247265273324301/lib/flask/app.py:1475)
- at handle_user_exception (/base/data/home/apps/s~gowcanteen/1.394247265273324301/lib/flask/app.py:1381)
- at full_dispatch_request (/base/data/home/apps/s~gowcanteen/1.394247265273324301/lib/flask/app.py:1477)
- at wsgi_app (/base/data/home/apps/s~gowcanteen/1.394247265273324301/lib/flask/app.py:1817)
00:12:15.755GET500264 B229 msChrome 51/api/menu
59.153.101.143 - - [19/Jul/2016:00:27:15 +0600] "GET /api/menu HTTP/1.1" 500 264 - "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36" "gowcanteen.appspot.com" ms=229 cpu_ms=9 cpm_usd=7.9236e-8 loading_request=0 instance=00c61b117c5074171089efe691fd68d35c03ec166588034655bca1bfd8a004a271 app_engine_release=1.9.40 trace_id=c96131dd18bfefe2658ed7980e9c28e9
{ metadata: {…} protoPayload: {…} insertId: "2016-07-18|11:27:19.295269-07|10.106.46.132|-1425448532" httpRequest: {…} operation: {…} }
Exception on /api/menu [GET]
Traceback (most recent call last):
File "/base/data/home/apps/s~gowcanteen/1.394294787305794312/lib/flask/app.py", line 1817, in wsgi_app
response = self.full_dispatch_request()
File "/base/data/home/apps/s~gowcanteen/1.394294787305794312/lib/flask/app.py", line 1477, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/base/data/home/apps/s~gowcanteen/1.394294787305794312/lib/flask/app.py", line 1381, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/base/data/home/apps/s~gowcanteen/1.394294787305794312/lib/flask/app.py", line 1475, in full_dispatch_request
rv = self.dispatch_request()
File "/base/data/home/apps/s~gowcanteen/1.394294787305794312/lib/flask/app.py", line 1461, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/base/data/home/apps/s~gowcanteen/1.394294787305794312/main.py", line 59, in API_MENU
return str(db.getMenuItems())
File "/base/data/home/apps/s~gowcanteen/1.394294787305794312/server.py", line 24, in getMenuItems
return self.menuSheet.get_all_values()
File "/base/data/home/apps/s~gowcanteen/1.394294787305794312/lib/gspread/models.py", line 339, in get_all_values
cells = self._fetch_cells()
File "/base/data/home/apps/s~gowcanteen/1.394294787305794312/lib/gspread/models.py", line 226, in _fetch_cells
feed = self.client.get_cells_feed(self)
File "/base/data/home/apps/s~gowcanteen/1.394294787305794312/lib/gspread/client.py", line 250, in get_cells_feed
r = self.session.get(url)
File "/base/data/home/apps/s~gowcanteen/1.394294787305794312/lib/gspread/httpsession.py", line 79, in get
return self.request('GET', url, **kwargs)
File "/base/data/home/apps/s~gowcanteen/1.394294787305794312/lib/gspread/httpsession.py", line 75, in request
raise HTTPError("%s: %s" % (response.status, response.read()))
HTTPError: 401: <HTML>
<HEAD>
<TITLE>Unauthorized</TITLE>
</HEAD>
<BODY BGCOLOR="#FFFFFF" TEXT="#000000">
<H1>Unauthorized</H1>
<H2>Error 401</H2>
</BODY>
</HTML>
Loading... Scanned up to 2016-07-19 (00:12:15.755)
--
You received this message because you are subscribed to the Google Groups "Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-appengi...@googlegroups.com.
To post to this group, send email to google-a...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-appengine.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-appengine/9ad3f1e8-3829-4786-938d-f8021b39695b%40googlegroups.com.