pub struct Http { /* private fields */ }
Expand description
Fields related to HTTP activity. Use the url
field set to store the url of the request.
Implementations§
Source§impl Http
impl Http
Sourcepub fn get_request_id(&self) -> Option<&String>
pub fn get_request_id(&self) -> Option<&String>
A unique identifier for each HTTP request to correlate logs between clients and servers in transactions.
The id may be contained in a non-standard HTTP header, such as X-Request-ID
or X-Correlation-ID
.
Sourcepub fn set_request_id(&mut self, request_id_arg: String)
pub fn set_request_id(&mut self, request_id_arg: String)
A unique identifier for each HTTP request to correlate logs between clients and servers in transactions.
The id may be contained in a non-standard HTTP header, such as X-Request-ID
or X-Correlation-ID
.
§Example
123e4567-e89b-12d3-a456-426614174000
Sourcepub fn get_request_method(&self) -> Option<&String>
pub fn get_request_method(&self) -> Option<&String>
HTTP request method.
The value should retain its casing from the original event. For example, GET
, get
, and GeT
are all considered valid values for this field.
Sourcepub fn set_request_method(&mut self, request_method_arg: String)
pub fn set_request_method(&mut self, request_method_arg: String)
HTTP request method.
The value should retain its casing from the original event. For example, GET
, get
, and GeT
are all considered valid values for this field.
§Example
POST
Sourcepub fn get_request_mime_type(&self) -> Option<&String>
pub fn get_request_mime_type(&self) -> Option<&String>
Mime type of the body of the request.
This value must only be populated based on the content of the request body, not on the Content-Type
header. Comparing the mime type of a request with the request’s Content-Type header can be helpful in detecting threats or misconfigured clients.
Sourcepub fn set_request_mime_type(&mut self, request_mime_type_arg: String)
pub fn set_request_mime_type(&mut self, request_mime_type_arg: String)
Mime type of the body of the request.
This value must only be populated based on the content of the request body, not on the Content-Type
header. Comparing the mime type of a request with the request’s Content-Type header can be helpful in detecting threats or misconfigured clients.
§Example
image/gif
Sourcepub fn get_request_body_content(&self) -> Option<&String>
pub fn get_request_body_content(&self) -> Option<&String>
The full HTTP request body.
Sourcepub fn set_request_body_content(&mut self, request_body_content_arg: String)
pub fn set_request_body_content(&mut self, request_body_content_arg: String)
Sourcepub fn get_request_referrer(&self) -> Option<&String>
pub fn get_request_referrer(&self) -> Option<&String>
Referrer for this HTTP request.
Sourcepub fn set_request_referrer(&mut self, request_referrer_arg: String)
pub fn set_request_referrer(&mut self, request_referrer_arg: String)
Sourcepub fn get_response_status_code(&self) -> Option<&u64>
pub fn get_response_status_code(&self) -> Option<&u64>
HTTP response status code.
Sourcepub fn set_response_status_code(&mut self, response_status_code_arg: u64)
pub fn set_response_status_code(&mut self, response_status_code_arg: u64)
Sourcepub fn get_response_mime_type(&self) -> Option<&String>
pub fn get_response_mime_type(&self) -> Option<&String>
Mime type of the body of the response.
This value must only be populated based on the content of the response body, not on the Content-Type
header. Comparing the mime type of a response with the response’s Content-Type header can be helpful in detecting misconfigured servers.
Sourcepub fn set_response_mime_type(&mut self, response_mime_type_arg: String)
pub fn set_response_mime_type(&mut self, response_mime_type_arg: String)
Mime type of the body of the response.
This value must only be populated based on the content of the response body, not on the Content-Type
header. Comparing the mime type of a response with the response’s Content-Type header can be helpful in detecting misconfigured servers.
§Example
image/gif
Sourcepub fn get_response_body_content(&self) -> Option<&String>
pub fn get_response_body_content(&self) -> Option<&String>
The full HTTP response body.
Sourcepub fn set_response_body_content(&mut self, response_body_content_arg: String)
pub fn set_response_body_content(&mut self, response_body_content_arg: String)
Sourcepub fn get_version(&self) -> Option<&String>
pub fn get_version(&self) -> Option<&String>
HTTP version.
Sourcepub fn set_version(&mut self, version_arg: String)
pub fn set_version(&mut self, version_arg: String)
Sourcepub fn get_request_bytes(&self) -> Option<&u64>
pub fn get_request_bytes(&self) -> Option<&u64>
Total size in bytes of the request (body and headers).
Sourcepub fn set_request_bytes(&mut self, request_bytes_arg: u64)
pub fn set_request_bytes(&mut self, request_bytes_arg: u64)
Sourcepub fn get_request_body_bytes(&self) -> Option<&u64>
pub fn get_request_body_bytes(&self) -> Option<&u64>
Size in bytes of the request body.
Sourcepub fn set_request_body_bytes(&mut self, request_body_bytes_arg: u64)
pub fn set_request_body_bytes(&mut self, request_body_bytes_arg: u64)
Sourcepub fn get_response_bytes(&self) -> Option<&u64>
pub fn get_response_bytes(&self) -> Option<&u64>
Total size in bytes of the response (body and headers).
Sourcepub fn set_response_bytes(&mut self, response_bytes_arg: u64)
pub fn set_response_bytes(&mut self, response_bytes_arg: u64)
Sourcepub fn get_response_body_bytes(&self) -> Option<&u64>
pub fn get_response_body_bytes(&self) -> Option<&u64>
Size in bytes of the response body.