2

I am making a GET request for JSON data from a server that requires custom headers. The server responds with accurate response codes when I add the authentication header but fails during the custom header.

This -

[request addValue:utcDate forHTTPHeaderField:@"­X-Custom-Date"];

causes the request to not receive a response from the server.

I can add the identical headers in a curl command and get a response so it is something particular to the NSMutableURLRequest class.

Has anyone encounter this issue?

2
  • What is utcDate? A string? Have you checked what is actually sent? Server log? Commented Oct 12, 2013 at 8:00
  • I recommend using tcpdump on the command line to confirm that what you're sending is what you expect, and to see if you get any response from the server or not. Commented Oct 13, 2013 at 21:36

1 Answer 1

2

The HTTP header in the above question was copied from an PDF API document. Apparently it pasted in a character that is not displayed and caused the request to fail.

You can copy the above request line into a program like vi and you will find the additional character before the X.

I have been searching for a way to force Xcode to display ALL characters without success.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.