3

I am working on an iOS which connects to a RESTFUL Web Service for consuming data. I am handling the error scenarios in connection: didFailWithError: delegate method.

Recently I came to know that, I need to handle few errors in connection: didReceiveResponse: delegate method also. Because, errors like 500 internal error and 400, 404 gets notified in connection: didReceiveResponse:.

But, one concern is I don't know how to test these scenarios. How do I reproduce the 500 or 400 specific errors? Any suggestion on this will help me a lot!!

Please correct me if my understanding is wrong.

Rashmi Ranjan mallick
  • 6,390
  • 8
  • 42
  • 59

1 Answers1

6

Use this website to call for every status code you might (probably) need http://httpstat.us/

examples: 400 500

Format of the response

HTTP/1.1 {status code} {status description}
Content-Type: text/plain
Content-Length: {something}
{any custom response headers}

{status code} {status description}
{list of any custom response headers we added}
Or Ron
  • 2,313
  • 20
  • 34