You can set the request_serializer
and response_serializer
both to :json
to properly send/receive JSON:
@client = AFMotion::Client.build("https://alpha-api.app.net/") do
request_serializer :json
response_serializer :json
end
AFNetworking will then use the AFJSONRequestSerializer
which will set the Content-Type
header to application/json
.