Documentation
¶
Index ¶
- func CreateHTTPResponse(statusCode int, redirectChain []string, headers map[string][]string, ...) common.HttpResponse
- func CreateResponseBody(contentType string, responseBody string) *common.Body
- func DetectContentType(body string) string
- func GetHeaderValueFromHeaderMap(headers map[string][]string, name string) *string
- func GetResponseBodyStringFromBodyStruct(body *common.Body) *string
- func RemoveScheme(url string) string
- func SplitTargetURL(target string) (string, string, error)
- type MethodFlagData
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateHTTPResponse ¶
func CreateHTTPResponse(statusCode int, redirectChain []string, headers map[string][]string, responseBody string) common.HttpResponse
CreateHTTPResponse creates an HttpResponse struct from HttpResponse data
func CreateResponseBody ¶ added in v0.0.93
CreateResponseBody creates a Body struct based on content type and response data
func DetectContentType ¶ added in v0.0.93
DetectContentType attempts to detect the content type from the response body
func GetHeaderValueFromHeaderMap ¶
GetHeaderValueFromHeaderMap extracts a single header value from response header map. Returns the first value found for the given header name, or nil if not found.
func GetResponseBodyStringFromBodyStruct ¶
GetResponseBodyStringFromBodyStruct extracts string content from a Body struct
func RemoveScheme ¶ added in v0.0.93
RemoveScheme removes http:// or https:// from the beginning of a string
Types ¶
type MethodFlagData ¶ added in v0.0.93
type MethodFlagData struct { RequestMethodEnum common.RequestMethod HeadlessConfig *common.HeadlessRequestConfig BrowserbaseConfig *common.BrowserbaseRequestConfig BrowserbaseSecrets *common.BrowserbaseRequestSecrets }
MethodFlagData holds all the configuration related to request methods
func GetRequestMethodFlags ¶ added in v0.0.93
func GetRequestMethodFlags(cmd *cobra.Command) (*MethodFlagData, error)
GetRequestMethodFlags extracts and validates all request method related configuration from a cobra command