request

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 15, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package request contains all the things used to create requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseURL

func ParseURL(base string, path string) string

ParseURL parses the configuration to generate the final URL that the request will be sent to.

Types

type ExecutedRequestResponse

type ExecutedRequestResponse struct {
	Request  Request
	Response Response
}

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 {
	FileToUpload   string
	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

func BuildRequest

func BuildRequest(unconfiguredRequest Request, requestName string, executionOptions ExecutionOptions) (*http.Request, *Request, error)

BuildRequest builds a Request from a Configuration.

func (*Request) Merge

func (original *Request) Merge(toMerge Request)

Merge merges information from another request into the original request, overwriting any data that is provided in toMerge.

type Response

type Response struct {
	Body       string
	Headers    map[string][]string
	Protocol   string
	StatusCode int
	Status     string
}

Response is the response from the daemon after executing a request

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL