Class: Google::Cloud::Logging::Entry::HttpRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/google/cloud/logging/entry/http_request.rb

Overview

Http Request

HTTP request data associated with a log entry.

See also #http_request.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cache_hitObject

Whether an entity was served from cache (with or without validation). (Boolean)



104
105
106
# File 'lib/google/cloud/logging/entry/http_request.rb', line 104

def cache_hit
  @cache_hit
end

#refererObject

The referer URL of the request, as defined in HTTP/1.1 Header Field Definitions. (String)



99
100
101
# File 'lib/google/cloud/logging/entry/http_request.rb', line 99

def referer
  @referer
end

#remote_ipObject

The IP address (IPv4 or IPv6) of the client that issued the HTTP request. Examples: "192.168.1.1", "FE80::0202:B3FF:FE1E:8329". (String)



93
94
95
# File 'lib/google/cloud/logging/entry/http_request.rb', line 93

def remote_ip
  @remote_ip
end

#request_methodObject

The request method. Examples: "GET", "HEAD", "PUT", "POST". (String)



36
37
38
# File 'lib/google/cloud/logging/entry/http_request.rb', line 36

def request_method
  @request_method
end

#response_sizeObject

The size of the HTTP response message sent back to the client, in bytes, including the response headers and the response body. (Integer)



81
82
83
# File 'lib/google/cloud/logging/entry/http_request.rb', line 81

def response_size
  @response_size
end

#sizeObject

The size of the HTTP request message in bytes, including the request headers and the request body. (Integer)



70
71
72
# File 'lib/google/cloud/logging/entry/http_request.rb', line 70

def size
  @size
end

#statusObject

The response code indicating the status of response. Examples: 200, 404. (Integer)



75
76
77
# File 'lib/google/cloud/logging/entry/http_request.rb', line 75

def status
  @status
end

#urlObject

The URL. The scheme (http, https), the host name, the path and the query portion of the URL that was requested. Example: "http://example.com/some/info?color=red". (String)



65
66
67
# File 'lib/google/cloud/logging/entry/http_request.rb', line 65

def url
  @url
end

#user_agentObject

The user agent sent by the client. Example: "Mozilla/4.0 (compatible; MSIE 6.0; Windows 98; Q312461; .NET CLR 1.0.3705)". (String)



87
88
89
# File 'lib/google/cloud/logging/entry/http_request.rb', line 87

def user_agent
  @user_agent
end

#validatedObject

Whether the response was validated with the origin server before being served from cache. This field is only meaningful if cache_hit is true. (Boolean)



110
111
112
# File 'lib/google/cloud/logging/entry/http_request.rb', line 110

def validated
  @validated
end

Instance Method Details

#methodObject

Deprecated. Use #request_method instead.

The request method. Examples: "GET", "HEAD", "PUT", "POST". (String)



44
45
46
47
48
49
# File 'lib/google/cloud/logging/entry/http_request.rb', line 44

def method *args
  # Call Object#method when args are present.
  return super unless args.empty?

  request_method
end

#methodObject

Deprecated. Use #request_method= instead.

The request method. Examples: "GET", "HEAD", "PUT", "POST". (String)



57
58
59
# File 'lib/google/cloud/logging/entry/http_request.rb', line 57

def method= new_request_method
  self.request_method = new_request_method
end