httpreq

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package httputils implements HTTP related utilities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromConfig

func FromConfig(c *configpb.HTTPRequest) (*http.Request, error)

NewRequest returns a new HTTP request object, with the given method, url, request body.

func NewRequest

func NewRequest(method, url string, reqBody *RequestBody) (*http.Request, error)

NewRequest returns a new HTTP request object, with the given method, url, request body.

Types

type RequestBody

type RequestBody struct {
	// contains filtered or unexported fields
}

RequestBody implements an HTTP request body.

func NewRequestBody

func NewRequestBody(data ...string) *RequestBody

NewRequestBody returns a new RequestBody object.

func (*RequestBody) ContentType

func (rb *RequestBody) ContentType() string

func (*RequestBody) Len

func (rb *RequestBody) Len() int64

func (*RequestBody) Read

func (rb *RequestBody) Read(p []byte) (int, error)

func (*RequestBody) Reader

func (rb *RequestBody) Reader() io.ReadCloser

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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