Example HTTP request with a JSON body
This is an example of a HTTP request with a JSON body.
POST /genapp/customers/
Host: www.example.com
Content-Type: application/json
Content-Length: nn 1
{
"customers":
{
"firstName": "Joe”,
"lastName": “Bloggs”,
"fullAddress":
{
"streetAddress": "21 2nd Street",
"city": "New York",
"state": "NY",
"postalCode": 10021
}
}
}
Where the Content-Length: nn
1 is
the length of your request.The COBOL language structure mapping for this example
would be as follows:
01 CUSTOMERS.
03 firstname pic x(8).
03 lastname pic x(8).
03 fulladdress.
05 streetaddress pic x(20).
05 city pic x(20).
05 state pic xx.
05 postalcode pic 9(5).