An example of including a comment in a JSON. Comments in the form // ... or / * ... * / are not allowed in JSON, but you may have a special element in your JSON, called for example, "_comment", which will contain your comment. The REST API endpoint must ignore this special JSON comment element. The Java code was automatically generated from the JSON Comment Example.
Can JSON contain comments?
Comments in the form //, #, or / * * / that are used in popular programming languages are not allowed in JSON. As a workaround, you can use a custom element in your JSON as shown in this JSON Comment Example. Your server and client must ignore this special element when processing the received JSON.
How do I send JSON to the server?
To send a JSON string to the server, you need to set the appropriate content type for the request body.
If your client is expecting JSON as a result of the submitted request, it should also send the Accept: application/json request header.
The server informs the client that it has returned JSON with a Content-Type: application/json response header.