Documentation
¶
Index ¶
- Constants
- func NormalizeEndpoint(endpoint string, backslash bool) string
- type Request
- func (r *Request) AddAuthorization(apiKey, jwtValue string)
- func (r *Request) AddBody(message interface{})
- func (r *Request) AddJSONHeaders()
- func (r *Request) AddMultipartBody(mBody bytes.Buffer)
- func (r *Request) AddPath(path string)
- func (r *Request) AddQueryParams(params map[string][]string)
- func (r *Request) GetBody() io.Reader
- func (r *Request) SetContentType(contentType string)
- type Response
Constants ¶
View Source
const ( Slash = "/" HeaderContentTypeKey = "Content-Type" JSONContentType = "application/json" )
Variables ¶
This section is empty.
Functions ¶
func NormalizeEndpoint ¶
normalizeEndpoint Normalize Endpoint considering ending backslash need.
Types ¶
type Request ¶
type Request struct {
// Endpoint of the HTTP server. It might include a base path.
Endpoint string
// Path of the API endpoint. This path is considered with the endpoint to invoke the HTTP server.
Path string
// Query parameters
QueryParams map[string][]string
// Request headers
Headers map[string][]string
// HTTP method
Method string
// Request body as slice of bytes
RequestBody []byte
// Multipart body
MultipartBody *bytes.Buffer
// Username for basic authentication
Username string
// Password for basic authentication
Password string
}
Request information of the Session.
func NewRequest ¶
func (*Request) AddAuthorization ¶
func (*Request) AddJSONHeaders ¶
func (r *Request) AddJSONHeaders()
AddJSONHeaders adds json headers to Request if they are null
func (*Request) AddMultipartBody ¶ added in v0.18.0
func (*Request) AddQueryParams ¶
func (*Request) SetContentType ¶ added in v0.18.0
Click to show internal directories.
Click to hide internal directories.