http

package module
v0.0.0-...-faeea24 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client = internal.Client

Client provides the basic API for sending HTTP requests

Example
cl := &Client{}
resp, err := cl.CtxDo(context.Background(), &Request{
	Method: "GET",
	URL:    "http://www.google.com/?a=b",
	Header: http.Header{
		// "Connection": {"close"},
	},
})
if err != nil {
	fmt.Println(err)
	return
}
defer resp.Body.Close()
b, err := io.ReadAll(resp.Body)
fmt.Println(err)
fmt.Println(string(b))
Output:

type Header = http.Header

type Request

type Request = http.Request

Requests are re-usable objects that are high-level representations of a HTTP request. A request would be "prepared" into *[PreparedRequest]s to be actually written into an underlying connection (i.e. a TCP stream)

type Response

type Response = http.Response

Responses are high-level representations of a HTTP response.

Directories

Path Synopsis
http
package http contains the request and response type, which are meant to be exported.
package http contains the request and response type, which are meant to be exported.
utils

Jump to

Keyboard shortcuts

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