Class | FTW::Request |
In: |
lib/ftw/request.rb
lib/ftw/request.rb |
Parent: | Object |
See RFC2616 section 5: <tools.ietf.org/html/rfc2616#section-5>
method | [RW] |
The http method. Like GET, PUT, POST, etc.. RFC2616 5.1.1 - <tools.ietf.org/html/rfc2616#section-5.1.1>
Warning: this accessor obscures the ruby Kernel#method() method. I would like to call this ‘verb’, but my preference is first to adhere to RFC terminology. Further, ruby‘s stdlib Net::HTTP calls this ‘method’ as well (See Net::HTTPGenericRequest). |
method | [RW] |
The http method. Like GET, PUT, POST, etc.. RFC2616 5.1.1 - <tools.ietf.org/html/rfc2616#section-5.1.1>
Warning: this accessor obscures the ruby Kernel#method() method. I would like to call this ‘verb’, but my preference is first to adhere to RFC terminology. Further, ruby‘s stdlib Net::HTTP calls this ‘method’ as well (See Net::HTTPGenericRequest). |
port | [RW] | RFC2616 section 14.23 allows the Host header to include a port, but I have never seen this in practice, and I shudder to think about what poorly-behaving web servers will barf if the Host header includes a port. So, instead of storing the port in the Host header, it is stored here. It is not included in the Request when sent from a client and it is not used on a server. |
port | [RW] | RFC2616 section 14.23 allows the Host header to include a port, but I have never seen this in practice, and I shudder to think about what poorly-behaving web servers will barf if the Host header includes a port. So, instead of storing the port in the Host header, it is stored here. It is not included in the Request when sent from a client and it is not used on a server. |
protocol | [RW] | This is not an RFC2616 field. It exists so that the connection handling this request knows what protocol to use. The protocol for this request. Usually ‘http’ or ‘https’ or perhaps ‘spdy’ maybe? |
protocol | [RW] | This is not an RFC2616 field. It exists so that the connection handling this request knows what protocol to use. The protocol for this request. Usually ‘http’ or ‘https’ or perhaps ‘spdy’ maybe? |
request_uri | [RW] | This is the Request-URI. Many people call this the ‘path’ of the request. RFC2616 5.1.2 - <tools.ietf.org/html/rfc2616#section-5.1.2> |
request_uri | [RW] | This is the Request-URI. Many people call this the ‘path’ of the request. RFC2616 5.1.2 - <tools.ietf.org/html/rfc2616#section-5.1.2> |
Make a new request with a uri if given.
The uri is used to set the address, protocol, Host header, etc.
Make a new request with a uri if given.
The uri is used to set the address, protocol, Host header, etc.
Execute this request on a given connection: Writes the request, returns a Response object.
This method will block until the HTTP response header has been completely received. The body will not have been read yet at the time of this method‘s return.
The ‘connection’ should be a FTW::Connection instance, but it might work with a normal IO object.
Execute this request on a given connection: Writes the request, returns a Response object.
This method will block until the HTTP response header has been completely received. The body will not have been read yet at the time of this method‘s return.
The ‘connection’ should be a FTW::Connection instance, but it might work with a normal IO object.
Set the method for this request. Usually something like "GET" or "PUT" etc. See <tools.ietf.org/html/rfc2616#section-5.1.1>
Set the method for this request. Usually something like "GET" or "PUT" etc. See <tools.ietf.org/html/rfc2616#section-5.1.1>