When logging in to GitHub, I found that directly using curl to simulate a get request cannot obtain user information, but pasting out the link can return information when the browser directly accesses it. Please tell me how to request it in PHP
黑岩*手2018-08-30 08:40:30
GitHub's documentation says that when calling the API, the request header needs to contain User-Agent, so directly file_get_content will produce a 403, and then the browser can access it. The solution is to use curl to simulate a get request and add User-Agent to the header of the request. You can copy the value from the browser.