Place API key in Headers or URL

前端 未结 5 1025
感动是毒
感动是毒 2020-12-04 09:53

I\'m designing a public API to my company\'s data. We want application developers to sign up for an API key so that we can monitor use and overuse.

Since the API is

5条回答
  •  伪装坚强ぢ
    2020-12-04 10:00

    passing api key in parameters makes it difficult for clients to keep their APIkeys secret, they tend to leak keys on a regular basis. A better approach is to pass it in header of request url.you can set user-key header in your code . For testing your request Url you can use Postman app in google chrome by setting user-key header to your api-key.

提交回复
热议问题