How do I send a GET request to get JSON? [PHP Code]

To get JSON from a REST API endpoint, you must send an HTTP GET request and pass the "Accept: application/json" request header to the server, which will tell the server that the client expects JSON in response. In this GET JSON example, we send a GET request to the ReqBin echo URL. Click Send to execute the GET JSON example online and see the results. The PHP code was automatically generated for the GET Request Retrieve JSON example.
Loading...