rest

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2024 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package rest provides a set of utilities for making RESTful API calls.

This package includes functions for sending HTTP requests, handling responses, and managing authentication and authorization headers.

Example usage:

// Create a new REST client
client := rest.NewClient()

// Set the base URL for the API
client.SetBaseURL("https://api.example.com")

// Set the authentication token
client.SetAuthToken("YOUR_AUTH_TOKEN")

// Send a GET request
response, err := client.Get("/users")
if err != nil {
    log.Fatal(err)
}

// Print the response body
fmt.Println(response.Body)

// Close the response body
response.Close()

For more information and examples, please refer to the package documentation.

Index

Constants

View Source
const (
	// ContentTypeHeader
	ContentTypeHeader = "Content-Type"
	// JSONContentType
	JSONContentType = "application/json"
	// XMLContentType
	XMLContentType = "text/xml"
	// XmlApplicationContentType
	XmlApplicationContentType = "application/xml"
	// YAMLContentType
	YAMLContentType = "text/yaml"

	// ProxyAuthorizationHeader
	ProxyAuthorizatio = "Proxy-Authorization"
	// AuthorizationHeader
	Authorization
	// AcceptHeader
	AcceptHeader = "Accept"
	// AcceptEncodingHeader
	AcceptEncodingHeader = "Accept-Encoding"
	// AcceptLanguageHeader
	AcceptLanguageHeader = "Accept-Language"

	// PathSeparator
	PathSeparator = "/"
)

Variables

This section is empty.

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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