![](/img/trans.png)
[英]Error JSON parsing request on Foursquare API Java running on Google Cloud Endpoints
[英]Google cloud endpoints generate Java api HTTP 400 error
嘿,我試圖通過使用此文檔的go-endpoints開發rest API
我可以在本地和應用程序引擎上測試我的應用程序。
但由於某種原因,我無法創建Java客戶端以便在Android設備上使用它,
HTTP 400無法解碼JSON對象
在此命令上
GO_SDK/endpointscfg.py gen_client_lib java MY_FILE_NAME
這是完整的堆棧跟蹤
mik@mik-Aspire-S3:~/go-programs/src/cloudEndPoints/app$ $HOME/go_appengine/endpointscfg.py gen_client_lib java ballota_test
Traceback (most recent call last):
File "/home/mik/go_appengine/endpointscfg.py", line 133, in <module>
run_file(__file__, globals())
File "/home/mik/go_appengine/endpointscfg.py", line 129, in run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/home/mik/go_appengine/google/appengine/tools/endpointscfg.py", line 561, in <module>
main(sys.argv)
File "/home/mik/go_appengine/google/appengine/tools/endpointscfg.py", line 557, in main
args.callback(args)
File "/home/mik/go_appengine/google/appengine/tools/endpointscfg.py", line 458, in _GenClientLibCallback
args.build_system)
File "/home/mik/go_appengine/google/appengine/tools/endpointscfg.py", line 335, in _GenClientLib
build_system, client_name)
File "/home/mik/go_appengine/google/appengine/tools/endpointscfg.py", line 366, in _GenClientLibFromContents
raise ServerRequestException(error)
__main__.ServerRequestException: HTTP 400 (Bad Request) error when communicating with URL: https://google-api-client-libraries.appspot.com/generate. Details: ill-formed JSON: No JSON object could be decoded
更新
我試圖將這個示例項目tictactoe作為Java客戶端構建,但遇到了相同的錯誤
我在crhym3雲終端示例中發布了一個問題,他幫助我了解了我的錯誤。
我的錯誤是我嘗試使用錯誤的URL地址創建客戶端。
這是錯誤的地址。
https://winged-precept-894.appspot.com這將返回404
這是正確的發現api URL。
https://winged-precept-894.appspot.com/_ah/api/discovery/v1/apis/myapp/v1/rpc
因此,這是一個url錯誤,而不是面向Json的錯誤。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.