Paw has the flexibility to send HTTP requests using different HTTP Libraries. This is mostly due to the limitations of Apple’s standard NSURLConnection library.
Paw HTTP Library
It’s the default library. It’s a custom HTTP library we built specifically for Paw, addressing the needs of a debugging tool. Built as an HTTP layer on top of GCDAsyncSocket (CocoaAsyncSocket), it allows Paw to show you exactly:
- what will be sent to the server (in the Request Code Generator,
Cmd+Shift+C
to show/hide, then select HTTP)
- what has been received from the server (in the Raw tab of the Response).
Warning: as the HTTP layer of this library is custom made for Paw, it hasn’t be as much tested over time than the 2 other ones. If you experience any problems, try to switch to another library it may fix it. However, please report any issue to the support, we want to hear from you and fix bugs asap!
Connection: close
To date, our custom HTTP layer does not support Keep-Alive connections. All connections are closed once the response is fully received. Also, the client sends a Connection: close
header by default to make it explicit to the server.
Serialization & Parsing of the HTTP messages
To serialize (generate) and parse HTTP messages, it uses a custom made parser instead of the standard CFHTTPMessage
.
ASIHTTPRequest
As its name suggests, it’s using ASIHTTPRequest which is a very well known HTTP library for iOS and OS X. Unfortunately, it’s now discontinued by the developer, which is one of the main reasons why it hasn’t been adopted as the default library for Paw.
Note that internally ASIHTTPRequest uses CFStream
for the socket connection, and CFNetwork
’s CFHTTPMessage
to serialization and parse HTTP messages.
NSURLConnection
This is Apple’s default HTTP library.
Inaccurate Status Line
The main concern when using this library is that the HTTP Status Line returned by the server isn’t correct. This is a limitation of this library. Instead, Apple provides the standard status line matching the status code.
For example, if a server responds: HTTP/1.1 404 CANNOT FIND THIS PAGE
, the status code shown will be 404
but the message will instead be NOT FOUND
.