Documentation
¶
Overview ¶
Package request contains all the things used to create requests.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseURL ¶
ParseURL parses the configuration to generate the final URL that the request will be sent to.
Example ¶
base := "http://localhost:3000/api/v1"
url := "/{companyId}/contacts"
context := map[string]string{
"companyId": "123456",
}
fmt.Println(ParseURL(base, url, context))
Output: http://localhost:3000/api/v1/123456/contacts
Types ¶
type ExecutedRequestResponse ¶
ExecutedRequestResponse represents a pair of request and the response that was returned from its execution.
func ExecuteRequest ¶
func ExecuteRequest(executionOptions ExecutionOptions) ([]ExecutedRequestResponse, error)
ExecuteRequest executes an HTTP request based on the specified options.
type ExecutionOptions ¶
type ExecutionOptions struct {
FollowLocation bool
MaxRedirect int
ProfileNames []string
RequestName string
Request Request
Variables map[string]string
}
ExecutionOptions represent the options to be passed for the request executor.
type Request ¶
type Request struct {
Body string
Cookies []*http.Cookie
Headers map[string][]string
Method string
URL string
}
Request stores data required to configure a request to be executed
Click to show internal directories.
Click to hide internal directories.