Module RFuzz::HttpEncoding
In: lib/rfuzz/client.rb

A mixin that has most of the HTTP encoding methods you need to work with the protocol. It’s used by HttpClient, but you can use it as well.

Methods

Public Instance methods

Converts a Hash of cookies to the appropriate simple cookie headers.

Encode HTTP header fields of "k: v\r\n"

Encodes the headers given in the hash returning a string you can use.

HTTP is kind of retarded that you have to specify a Host header, but if you include port 80 then further redirects will tack on the :80 which is annoying.

URL encodes a single k=v parameter.

Takes a query string and encodes it as a URL encoded set of key=value pairs with & separating them.

Performs URI escaping so that you can construct proper query strings faster. Use this rather than the cgi.rb version since it’s faster. (Stolen from Camping).

Parses a query string by breaking it up at the ’&’ and ’;’ characters. You can also use this to parse cookies by changing the characters used in the second parameter (which defaults to ’&;’.

Unescapes a URI escaped string. (Stolen from Camping).

[Validate]