What does a JSON-encoded request look like?
2 answers
RFC 4627 recommends a mime / json type application. You can read the request data with php: // input .
+1
a source to share
The mime type for json is application/json
, but I doubt it hasn't had time to add that to the answers yet.
The easiest way to define a json response is that it will most likely be wrapped in curly braces and have colons after each member. But this is still not the right way to find out about this json.
The easiest way to test it with PHP is to try json_decode if it throws an error, either it's not json, or malformed json and so you still won't be able to use it.
0
a source to share