Cannot access API explorer on localhost

只愿长相守 提交于 2019-11-28 06:28:11

The URL for the API Explorer is correct, but there have been some issues (apparently not all resolved) where the API Explorer doesn't correctly list your APIs.

As comparison of how it should look like https://developers.google.com/apis-explorer/ is the API Explorer for Google APIs, far more APIs than you would normally host yourself, but just to give you an idea of what you should see: a list of APIs and details for each API once you click on it.

A workaround that usually worked is to explicitly add the name and version of your API to the URL, so since your API is called scrnxSync with version v1 this link should show you the methods you defined for your API, and allow you to call those methods:

https://developers.google.com/apis-explorer/?base=http://localhost:8080/_ah/api#p/scrnxSync/v1/

Something changed, and now you must start Chrome in a specific way to use api explorer on localhost development server

here is a link to info from google.

But for me it still didn't fix using api explorer with localhost dev server.
I find that a possible workaround is to launch Chrome with the flag "--allow-running-insecure-content"
On MacOs in terminal run this:

/Applications/Google\ Chrome.app/Contents/Mac/Google\ Chrome --user-data-dir=test --allow-running-insecure-content

If you are using Chrome browser, just make https in the URL to http. It worked for me.

http://apis-explorer.appspot.com/apis-explorer/?base=http://localhost:8080/_ah/api#p/

Andrés Muñoz

I tried all of the above in chrome and nothing works for me, but using firefox I just click in the lock at the left of the url bar and disable the security. That made the trick for me, cheers !! :D

A quick fix: Open the link: http://apis-explorer.appspot.com/apis-explorer/?base=http://localhost:8080/_ah/api#p/ in firefox , then click the secure connection icon on the nav bar, then click disable protection. You should be able to see your APIs

ps; Remember to edit 8080 with your port number

I'm also new to GAE Endpoints, and I had the same problem. In my case, I had this error because of the order of the url handlers in the app.yaml. I had it like this:

- url: /.*
  script: core_service.application

  # Endpoints handler
- url: /_ah/spi/.*
  script: api_service.application

The right way is defining first the most specific routes and at the end the most general (/.*). Like this:

  # Endpoints handler
- url: /_ah/spi/.*
  script: api_service.application

- url: /.*
  script: core_service.application

I know it is not exactly the same problem but I was having the message "You are exploring an API that is described or served via HTTP instead of HTTPS. This is insecure and may be blocked by your browser. To fix this, set up a TLS proxy for your API. Alternatively, you can tell your browser to allow active content via HTTP at this site (on Chrome, click the shield in the URL bar), but this will not improve security or dismiss this message."

Clicking the shield icon in the address bar of Chrome did it for me.

If you are running the AppEngine from GWT DevMode you need to change port in the base parameter to match what you see in console, for me that's 8888:

http://apis-explorer.appspot.com/apis-explorer/?base=http://localhost:8888/_ah/api#p/

For me, it is a very simple typo in app.yaml. If you have the same problem, it can be just this simple:

Instead of (which is correct):

- url: /_ah/spi/.*
  script: services.application

I put:

- url: /_ah/api/.*
  script: services.application

Changing api back to spi did the trick.

The problem is that your python file can't find the import for:

from protorpc import remote

Therefore use the terminal, skip the GUI, navigate to the appengine sdk directory and put your project in there. For mac it is:

/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/

I was having the same issue but it turned out that I was specifying the wrong port on localhost. When the dev server(s) start up the log specifies three discreet ports on localhost:

INFO 2015-07-26 03:46:56,023 api_server.py:172] Starting API server at: http:// localhost:35714

INFO 2015-07-26 03:46:56,027 dispatcher.py:186] Starting module "default" running at: http:// localhost:8080

INFO 2015-07-26 03:46:56,028 admin_server.py:118] Starting admin server at: http:// localhost:8000

The issue was that I was trying to use the port for the api server but you need to just use the port for the default module.

This works: http:// localhost:8080/_ah/api/explorer (I needed to click the shield in chrome and allow unsafe scripts because the url is unencrypted)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!