Documentation ¶
Overview ¶
* Copyright (c) 2023 Juice Technologies, Inc. All Rights Reserved.
Index ¶
- func Get[T any](client *http.Client, url string) (T, error)
- func ParseBody(body io.Reader, length int64) ([]byte, error)
- func Post[T any](client *http.Client, url string) (T, error)
- func PostNoResponse(client *http.Client, url string) error
- func PostWithBody[T, T1 any](client *http.Client, url string, obj T1) (T, error)
- func PostWithBodyNoResponse[T any](client *http.Client, url string, obj T) error
- func PostWithBodyReturnString[T any](client *http.Client, url string, obj T) (string, error)
- func ReadBody[T any](header http.Header, statusCode int, body io.ReadCloser, contentLength int64) (T, error)
- func ReadBodyAsBytes(header http.Header, statusCode int, body io.ReadCloser, contentLength int64) ([]byte, error)
- func ReadRequestBody[T any](r *http.Request) (T, error)
- func ReadResponseBody[T any](r *http.Response) (T, error)
- func ReadResponseBodyAsString(r *http.Response) (string, error)
- func Respond[T any](w http.ResponseWriter, code int, obj T) error
- func RespondEmpty(w http.ResponseWriter, code int)
- func RespondWithString(w http.ResponseWriter, code int, msg string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PostWithBody ¶
func PostWithBodyNoResponse ¶ added in v0.1.1
func PostWithBodyReturnString ¶ added in v0.1.1
func ReadBodyAsBytes ¶
func ReadResponseBodyAsString ¶ added in v0.1.1
func RespondEmpty ¶
func RespondEmpty(w http.ResponseWriter, code int)
func RespondWithString ¶
func RespondWithString(w http.ResponseWriter, code int, msg string) error
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.