I exactly agree with @deceze but I want to develop this "I get an error from the service" part of the question,
We getting this kind of errors as http 415
Http 415 Unsupported Media type error
The HTTP 415 Unsupported Media Type client error response code indicates that the server refuses to accept the request because the payload format is in an unsupported format.
The format problem might be due to the request's indicated Content-Type or Content-Encoding, or as a result of inspecting the data directly.
In other words, such is seen in this example.
Content-Type: application/json
and Accept: application/json
. Otherwise, it will assume the default