HTTP

This documentation provides details about the data that can be faked for HTTP data.

To retrieve generated/fake data for HTTP information see the following capabilities:

from socfaker import SocFaker

sc = SocFaker()

print(sc.http.request)
print(sc.http.response)
print(sc.http.status_code)
print(sc.http.method)
print(sc.http.bytes)

HTTP Class

class socfaker.http.HTTP

This class contains information related to HTTP data

Returns:
HTTP: Returns an object contianing properties related to HTTP data
bytes

Random bytes for an HTTP request

Returns:
int: Random bytes for an HTTP request
method

A randomly selected method for an HTTP request or response

Returns:
str: A randomly selected method for an HTTP request or response
request

A randomly generated request dictionary based on Elastic ECS format

Returns:
dict: A random request dictionary containing body, bytes, method and referrer information
response

A randomly generated response dictionary based on Elastic ECS format

Returns:
dict: A random response dictionary containing body, bytes, and status code information
status_code

A randomly selected status_code for an HTTP request or response

Returns:
str: A randomly selected status code for an HTTP request or response