apiutil

package
v0.7.7-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultQueryKeys = []string{"id", "name", "order"}

DefaultQueryKeys provides the standard set of allowed query parameters.

Functions

func FlattenFormData

func FlattenFormData(formData url.Values) map[string]interface{}

FlattenFormData converts URL-encoded form values into a flat map.

func HandleAPIResponse

func HandleAPIResponse(resp *http.Response) (interface{}, int, error)

HandleAPIResponse decodes JSON or XML responses and falls back to plain text.

func IsJSONResponse

func IsJSONResponse(resp *http.Response) bool

IsJSONResponse reports whether the response contains JSON data.

func IsXMLResponse

func IsXMLResponse(resp *http.Response) bool

IsXMLResponse reports whether the response contains XML data.

func NewHTTPClient

func NewHTTPClient() *http.Client

NewHTTPClient creates an HTTP client with isolated cookies and shared transport.

Types

This section is empty.

Jump to

Keyboard shortcuts

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