Documentation ¶
Index ¶
Constants ¶
const ( // JSONContentType is the Content-Type header for // JSON payloads. JSONContentType = "application/json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FormData ¶
type FormData struct {
// contains filtered or unexported fields
}
FormData defines the payload for URL encoded types.
func (*FormData) ContentType ¶
ContentType returns the `Content-Type` header.
type JSONData ¶
type JSONData struct {
// contains filtered or unexported fields
}
JSONData defines the payload for JSON types.
func NewJSONData ¶
NewJSONData creates a new JSON Data Payload type. It adds a struct type to the JSON Data payload. Returns an error if the struct could not be marshalled or unmarshalled.
func (*JSONData) ContentType ¶
ContentType returns the `Content-Type` header.
type Payload ¶
type Payload interface { // Buffer returns the byte buffer used for making the // HTTP Request Buffer() (*bytes.Buffer, error) // ContentType returns the `Content-Type` header used for // making the HTTP Request ContentType() string // Values returns a map of key - value pairs used for testing // and debugging. Values() map[string]string }
Payload defines the methods used for creating HTTP payload helper.
type Request ¶
type Request struct { Method string URL string Headers map[string]string BasicAuthUser string BasicAuthPassword string }
A Request represents an HTTP request received by a server or to be sent by a client. It is an extension of the std http.Request for Go Mail.
func NewHTTPRequest ¶
NewHTTPRequest returns a new Request given a method and URL.
func (*Request) SetBasicAuth ¶
SetBasicAuth sets the request's Authorization header to use HTTP Basic Authentication with the provided username and password.
With HTTP Basic Authentication the provided username and password are not encrypted.