fasthttp2curl

package module
v0.28.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2022 License: Apache-2.0, MIT Imports: 7 Imported by: 0

README

Fast Http To Curl

Coverage Status Renovate enabled Build status Build status Go Report Card

Supports net/http and fasthttp

Allows you to transform net/http and fasthttp to curl for debugging. This package is based on moul's http to curl command except it supports fast http and http. This package is tested for parity against moul/http

License

The original project is licensed by Manfred Touron under the Apache License, Version 2.0 (LICENSE-APACHE) or the MIT license (LICENSE-MIT), at your option. See the COPYRIGHT file for more details. Licenses are included in the directory

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FastHttpHeaderToHttp

func FastHttpHeaderToHttp(req *fasthttp.Request) (headers http.Header)

transofrm a fast http request to a list of http headers

Types

type CurlCommand

type CurlCommand []string

CurlCommand contains exec.Command compatible slice + helpers

func GetCurlCommand

func GetCurlCommand(req *http.Request) (command *CurlCommand, err error)

GetCurlCommand returns a CurlCommand corresponding to an http.Request

func GetCurlCommandFastHttp

func GetCurlCommandFastHttp(req *fasthttp.Request) (command *CurlCommand, err error)

convert a fast http request object to a curl command

func (*CurlCommand) Append

func (command *CurlCommand) Append(newSlice ...string)

Append appends a string to the CurlCommand

func (*CurlCommand) String

func (command *CurlCommand) String() string

String returns a ready to copy/paste command

Jump to

Keyboard shortcuts

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