I would suggest you consider two aspects of the request:
You are not showing us your setting of
msgLength
, but I would only suggest setting aContent-Length
header if you're also usingsetHTTPBody
, in which case you'd set theContent-Length
to be thelength
of theNSData
you use as a parameter tosetHTTPBody
. But this is used withPOST
requests, notGET
requests.You specify
application/json
for theContent-Type
of the request, but request does not consist of JSON. If you did that because the response is JSON, it should be noted that this header value is for your request, not for the response you expect from the server.