Documentation ¶
Index ¶
- func CreateRequest(ctx context.Context, httpMethod string, baseUrl string, requestPath string, ...) (*http.Request, errors.EdgeX)
- func CreateRequestFromFilePath(ctx context.Context, httpMethod string, baseUrl string, requestPath string, ...) (*http.Request, errors.EdgeX)
- func CreateRequestWithEncodedData(ctx context.Context, httpMethod string, baseUrl string, requestPath string, ...) (*http.Request, errors.EdgeX)
- func CreateRequestWithRawData(ctx context.Context, httpMethod string, baseUrl string, requestPath string, ...) (*http.Request, errors.EdgeX)
- func CreateRequestWithRawDataAndHeaders(ctx context.Context, httpMethod string, baseUrl string, requestPath string, ...) (*http.Request, errors.EdgeX)
- func CreateRequestWithRawDataAndParams(ctx context.Context, httpMethod string, baseUrl string, requestPath string, ...) (*http.Request, errors.EdgeX)
- func DeleteRequest(ctx context.Context, returnValuePointer interface{}, baseUrl string, ...) errors.EdgeX
- func DeleteRequestWithParams(ctx context.Context, returnValuePointer interface{}, baseUrl string, ...) errors.EdgeX
- func EscapeAndJoinPath(apiRoutePath string, pathVariables ...string) string
- func FromContext(ctx context.Context, key string) string
- func GetRequest(ctx context.Context, returnValuePointer interface{}, baseUrl string, ...) errors.EdgeX
- func GetRequestAndReturnBinaryRes(ctx context.Context, baseUrl string, requestPath string, ...) (res []byte, contentType string, edgeXerr errors.EdgeX)
- func GetRequestWithBodyRawData(ctx context.Context, returnValuePointer interface{}, baseUrl string, ...) errors.EdgeX
- func PatchRequest(ctx context.Context, returnValuePointer interface{}, baseUrl string, ...) errors.EdgeX
- func PostByFileRequest(ctx context.Context, returnValuePointer interface{}, baseUrl string, ...) errors.EdgeX
- func PostRequest(ctx context.Context, returnValuePointer interface{}, baseUrl string, ...) errors.EdgeX
- func PostRequestWithRawData(ctx context.Context, returnValuePointer interface{}, baseUrl string, ...) errors.EdgeX
- func PostRequestWithRawDataAndHeaders(ctx context.Context, returnValuePointer interface{}, baseUrl string, ...) errors.EdgeX
- func PutByFileRequest(ctx context.Context, returnValuePointer interface{}, baseUrl string, ...) errors.EdgeX
- func PutRequest(ctx context.Context, returnValuePointer interface{}, baseUrl string, ...) errors.EdgeX
- func SendRequest(ctx context.Context, req *http.Request, ...) ([]byte, errors.EdgeX)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateRequest ¶
func CreateRequestFromFilePath ¶
func CreateRequestFromFilePath(ctx context.Context, httpMethod string, baseUrl string, requestPath string, filePath string) (*http.Request, errors.EdgeX)
CreateRequestFromFilePath creates multipart/form-data request with the specified file
func DeleteRequest ¶
func DeleteRequest(ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string, authInjector interfaces.AuthenticationInjector) errors.EdgeX
DeleteRequest makes the delete request and return the body
func DeleteRequestWithParams ¶
func DeleteRequestWithParams(ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string, requestParams url.Values, authInjector interfaces.AuthenticationInjector) errors.EdgeX
DeleteRequestWithParams makes the delete request with URL query params and return the body
func EscapeAndJoinPath ¶
EscapeAndJoinPath escape and join the path variables
func FromContext ¶
FromContext allows for the retrieval of the specified key's value from the supplied Context. If the value is not found, an empty string is returned.
func GetRequest ¶
func GetRequest(ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string, requestParams url.Values, authInjector interfaces.AuthenticationInjector) errors.EdgeX
GetRequest makes the get request and return the body
func GetRequestAndReturnBinaryRes ¶
func GetRequestAndReturnBinaryRes(ctx context.Context, baseUrl string, requestPath string, requestParams url.Values, authInjector interfaces.AuthenticationInjector) (res []byte, contentType string, edgeXerr errors.EdgeX)
GetRequestAndReturnBinaryRes makes the get request and return the binary response and content type(i.e., application/json, application/cbor, ... )
func GetRequestWithBodyRawData ¶
func GetRequestWithBodyRawData(ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string, requestParams url.Values, data interface{}, authInjector interfaces.AuthenticationInjector) errors.EdgeX
GetRequestWithBodyRawData makes the GET request with JSON raw data as request body and return the response
func PatchRequest ¶
func PatchRequest( ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string, requestParams url.Values, data interface{}, authInjector interfaces.AuthenticationInjector) errors.EdgeX
PatchRequest makes a PATCH request and unmarshals the response to the returnValuePointer
func PostByFileRequest ¶
func PostByFileRequest( ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string, filePath string, authInjector interfaces.AuthenticationInjector) errors.EdgeX
PostByFileRequest makes the post file request and return the body
func PostRequest ¶
func PostRequest( ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string, data []byte, encoding string, authInjector interfaces.AuthenticationInjector) errors.EdgeX
PostRequest makes the post request with encoded data and return the body
func PostRequestWithRawData ¶
func PostRequestWithRawData( ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string, requestParams url.Values, data interface{}, authInjector interfaces.AuthenticationInjector) errors.EdgeX
PostRequestWithRawData makes the post JSON request with raw data and return the body
func PostRequestWithRawDataAndHeaders ¶
func PostRequestWithRawDataAndHeaders( ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string, requestParams url.Values, data interface{}, authInjector interfaces.AuthenticationInjector, headers map[string]string) errors.EdgeX
PostRequestWithRawDataAndHeaders makes the post JSON request with raw data and request headers, and returns the body
func PutByFileRequest ¶
func PutByFileRequest( ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string, filePath string, authInjector interfaces.AuthenticationInjector) errors.EdgeX
PutByFileRequest makes the put file request and return the body
func PutRequest ¶
func PutRequest( ctx context.Context, returnValuePointer interface{}, baseUrl string, requestPath string, requestParams url.Values, data interface{}, authInjector interfaces.AuthenticationInjector) errors.EdgeX
PutRequest makes the put JSON request and return the body
func SendRequest ¶
func SendRequest(ctx context.Context, req *http.Request, authInjector interfaces.AuthenticationInjector) ([]byte, errors.EdgeX)
SendRequest will make a request with raw data to the specified URL. It returns the body as a byte array if successful and an error otherwise.
Types ¶
This section is empty.