Module: Tilia::Http::RequestInterface

Includes:
MessageInterface
Included in:
Request, RequestDecorator
Defined in:
lib/tilia/http/request_interface.rb

Overview

The RequestInterface represents a HTTP request.

Instance Method Summary collapse

Methods included from MessageInterface

#add_header, #add_headers, #body, #body=, #body_as_stream, #body_as_string, #header, #header?, #header_as_array, #headers, #http_version, #http_version=, #remove_header, #update_header, #update_headers

Instance Method Details

#absolute_urlString

Returns the absolute url.

Returns:

  • (String)


36
37
# File 'lib/tilia/http/request_interface.rb', line 36

def absolute_url
end

#absolute_url=(_url) ⇒ void

This method returns an undefined value.

Sets the absolute url.

Parameters:

  • url (String)


43
44
# File 'lib/tilia/http/request_interface.rb', line 43

def absolute_url=(_url)
end

#base_urlString

Returns the current base url.

Returns:

  • (String)


49
50
# File 'lib/tilia/http/request_interface.rb', line 49

def base_url
end

#base_url=(_url) ⇒ void

This method returns an undefined value.

Sets a base url.

This url is used for relative path calculations.

The base url should default to /

Parameters:

  • url (String)


60
61
# File 'lib/tilia/http/request_interface.rb', line 60

def base_url=(_url)
end

#methodString

Returns the current HTTP method

Returns:

  • (String)


10
11
# File 'lib/tilia/http/request_interface.rb', line 10

def method
end

#method=(_method) ⇒ void

This method returns an undefined value.

Sets the HTTP method

Parameters:

  • method (String)


17
18
# File 'lib/tilia/http/request_interface.rb', line 17

def method=(_method)
end

#pathString

Returns the relative path.

This is being calculated using the base url. This path will not start with a slash, so it will always return something like ‘example/path.html’.

If the full path is equal to the base url, this method will return an empty string.

This method will also urldecode the path, and if the url was incoded as ISO-8859-1, it will convert it to UTF-8.

If the path is outside of the base url, a LogicException will be thrown.

Returns:

  • (String)


78
79
# File 'lib/tilia/http/request_interface.rb', line 78

def path
end

#post_dataObject

Returns the POST data.

This is equivalent to PHP’s $_POST superglobal.

Returns:

  • array



94
95
# File 'lib/tilia/http/request_interface.rb', line 94

def post_data
end

#post_data=(_post_data) ⇒ void

This method returns an undefined value.

Sets the post data.

This is equivalent to PHP’s $_POST superglobal.

This would not have been needed, if POST data was accessible as php://input, but unfortunately we need to special case it.

Parameters:

  • array

    post_data



106
107
# File 'lib/tilia/http/request_interface.rb', line 106

def post_data=(_post_data)
end

#query_parametersObject

Returns the list of query parameters.

This is equivalent to PHP’s $_GET superglobal.

Returns:

  • array



86
87
# File 'lib/tilia/http/request_interface.rb', line 86

def query_parameters
end

#raw_server_data=(_data) ⇒ void

This method returns an undefined value.

Sets the _SERVER array.

Parameters:

  • array

    data



122
123
# File 'lib/tilia/http/request_interface.rb', line 122

def raw_server_data=(_data)
end

#raw_server_value(_value_name) ⇒ String?

Returns an item from the _SERVER array.

If the value does not exist in the array, null is returned.

Parameters:

  • value_name (String)

Returns:

  • (String, nil)


115
116
# File 'lib/tilia/http/request_interface.rb', line 115

def raw_server_value(_value_name)
end

#urlString

Returns the request url.

Returns:

  • (String)


23
24
# File 'lib/tilia/http/request_interface.rb', line 23

def url
end

#url=(_url) ⇒ void

This method returns an undefined value.

Sets the request url.

Parameters:

  • url (String)


30
31
# File 'lib/tilia/http/request_interface.rb', line 30

def url=(_url)
end