@main("Validating JSON") {
Send an HTTP POST request to /products
with a Content-Type: application/json
header and a request body such as:
{
"name": "Blue Paper clips",
"ean": 12345432123,
"description": "Big box of paper clips",
"pieces": 500,
"manufacturer": {
"name": "Paperclipfactory Inc.",
"contact_details": {
"email": "contact@@paperclipfactory.example.com",
"fax": null,
"phone": "+12345654321"
}
},
"tags": [
"paperclip",
"coated"
],
"active": true
}
From the command line:
curl --include -X POST -H "Content-Type: application/json" --data-binary @@data/valid.json "http://localhost:9000/products"