http

package
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: 9 Imported by: 0

Documentation

Overview

package http contains the request and response type, which are meant to be exported. the package name is meant to be same with the top level package name so that IDEs and code editors could pick them up

the package also contains some type and value aliases from standard library to avoid annoying imports

Index

Constants

This section is empty.

Variables

View Source
var NoBody = http.NoBody

Functions

This section is empty.

Types

type Header = http.Header

type PreparedRequest

type PreparedRequest struct {
	*Request

	U          *url.URL
	GetBody    func() (io.ReadCloser, error)
	Header     http.Header
	HeaderHost string

	ContentLength int64
}

type Request

type Request struct {
	Method string
	URL    string
	Body   interface{}
	Header http.Header
}

Request is an object holding minimal information a request contains. it should not contain connection related information, such as proxies, context, response, connection info and "Close". it should be handled instead by [Dialer]s.

func (*Request) Prepare

func (r *Request) Prepare() (*PreparedRequest, error)

type Response

type Response struct {
	Proto      string
	Status     string
	StatusCode int
	Header     http.Header

	ContentLength int64
	Body          io.ReadCloser
}

Jump to

Keyboard shortcuts

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