requestr

package module
v0.0.0-...-0ad2bae Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

README

requestr

license

requestr is an HTTP request library, made for exploit writing. It seeks to simplify HTTP requests in Golang by eliminating boilerplate code.

As a goal for myself, I set out to work towards the OSWE certification completely in Golang (because I loved it that much). However, it made me realise how overly verbose making requests in Golang was, and so this package was born.

It is currently still a WIP, and requires much more refactoring and abstractions for it to become what I envision it should be.

Installation

go get -u github.com/iPhantasmic/requestr

TODO:

  1. Abstract HTTP Auth
  2. Abstract POST request types
  3. Better Cookie handling

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Client *http.Client

Functions

func CreateMultipartFormData

func CreateMultipartFormData(form map[string]string) (b bytes.Buffer, w *multipart.Writer)

func PrintFailure

func PrintFailure(message string)

func PrintInfo

func PrintInfo(message string)

func PrintSuccess

func PrintSuccess(message string)

Types

type DeleteRequest

type DeleteRequest struct {
	AuthUser string
	AuthPass string
}

type GetRequest

type GetRequest struct {
	AuthUser string
	AuthPass string
}

type PostRequest

type PostRequest struct {
	AuthUser      string
	AuthPass      string
	ContentType   string
	Cookies       []*http.Cookie
	FormData      url.Values
	Headers       map[string]string
	JsonData      []byte
	MultipartData map[string]string
	XmlData       []byte
}

type Response

type Response struct {
	StatusCode      int
	ContentLength   int64
	ResponseBody    string
	ResponseHeaders map[string]string
}

func SendDeleteRequest

func SendDeleteRequest(debug bool, requestURL string, deleteRequest DeleteRequest) Response

func SendGetRequest

func SendGetRequest(debug bool, requestURL string, getRequest GetRequest) Response

func SendPostRequest

func SendPostRequest(debug bool, requestURL string, postRequest PostRequest) Response

Jump to

Keyboard shortcuts

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