Envato API 从服务器发送 POST 请求
Envato API send POST request from server
他们这样说:
After the user has logged in and given their permission, the Envato
API will redirect them back to your application on the Confirmation
URL provided, with a single-use authentication code provided in the
query string (eg. http://your.app/callback?code=abc123...). You must
use this code to request an access token from the API, by sending the
following POST request from your server (encoded as
application/x-www-form-urlencoded), replacing [CODE] with the code
you've just received, [CLIENT_SECRET] with your secret application
key, and the other fields as necessary:
POST https://api.envato.com/token
grant_type=authorization_code&
code=[CODE]&
client_id=[CLIENT_ID]&
client_secret=[CLIENT_SECRET]
我可以通过 $_GET('code'); 获取代码如何向 url 提出 post 请求?
您可能想要使用 curl 或类似的库。这是一个关于 curl 的快速教程,其中包含 post:http://codular.com/curl-with-php。它甚至提到了 oauth,这听起来像你在做什么。
他们这样说:
After the user has logged in and given their permission, the Envato API will redirect them back to your application on the Confirmation URL provided, with a single-use authentication code provided in the query string (eg. http://your.app/callback?code=abc123...). You must use this code to request an access token from the API, by sending the following POST request from your server (encoded as application/x-www-form-urlencoded), replacing [CODE] with the code you've just received, [CLIENT_SECRET] with your secret application key, and the other fields as necessary:
POST https://api.envato.com/token
grant_type=authorization_code&
code=[CODE]&
client_id=[CLIENT_ID]&
client_secret=[CLIENT_SECRET]
我可以通过 $_GET('code'); 获取代码如何向 url 提出 post 请求?
您可能想要使用 curl 或类似的库。这是一个关于 curl 的快速教程,其中包含 post:http://codular.com/curl-with-php。它甚至提到了 oauth,这听起来像你在做什么。