Test JSON API Online [PHP Code]

ReqBin is the best online JSON API testing tool. Test JSON API endpoints by sending JSON API requests directly from your browser. Validate returned JSON strings with JSON syntax highlighting and code validators. Use the ReqBin JSON API Testing tool to validate your JSON response for API endpoints using auto syntax highlighting and a JSON validator. The PHP code was automatically generated for the Test JSON API example.
Test JSON API Online [PHP Code] Send
GET /echo/get/json HTTP/1.1
Host: reqbin.com

Updated: Viewed: 29418 times
PHP code for Test JSON API example

PHP code for Test JSON API Example

This PHP code snippet was generated automatically for the Test JSON API example.
<< Back to the Test JSON API example

What is JSON?

JSON (JavaScript Object Notation) is a textual format for representing structured data based on the syntax of a JavaScript object. JSON is used in almost all scripting languages, including JavaScript, Java, PHP, Python, C++, C#, Go, and many others. JSON is self-describing, easy to understand, and language independent. JSON is used for client/server communication in web and mobile applications.

JSON Example
{
  "Id": 78912,
  "Customer": "Jason Sweet",
  "Quantity": 1,
  "Price": 18.00
}

What is API?

API (Application Programming Interface) are protocols for creating and integrating application software. An API is a software intermediary that allows two systems to communicate. APIs are compatible with HTTP and REST standards, convenient, and easy to use for developers. APIs are usually well documented and consistent with version control systems.

What is JSON API?

JSON API is a textual data exchange format that specifies how clients should request data from the server and how the server should respond to those requests. The JSON API provides better-caching functionality and optimizes HTTP requests by eliminating unnecessary server requests. The JSON API is described at JSONAPI.org and differs from the REST API.

What are the benefits of the JSON API?

The main benefit of the JSON API is that it reduces the number of requests and the amount of data that is transferred between clients and servers.

How to test JSON API?

The following is an example of a JSON API request to ReqBin echo URL:

JSON API Request Example
GET /echo/get/json HTTP/1.1
Host: reqbin.com

Server response to our JSON API Request:

JSON API Response Example
HTTP/1.1 200 OK
Content-Type: application/vnd.api+json
Content-Length: 19

{"success":"true"}

See also

Generate code snippets for PHP and other programming languages

Convert your Test JSON API request to the PHP, JavaScript/AJAX, Node.js, Curl/Bash, Python, Java, C#/.NET code snippets using the PHP code generator.