methods

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2020 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Contenttypes = map[string]string{
	"html":  "text/html",
	"js":    "application/json",
	"xml":   "application/xml",
	"plain": "text/plain",
}

Contenttypes can be used in Place for ctypes

Functions

func BasicRequestWithBody added in v0.0.5

func BasicRequestWithBody(c *cli.Context, method string) (string, error)

BasicRequestWithBody sends put|patch|post|delete requests

func Getbasic

func Getbasic(c *cli.Context) (string, error)

Getbasic sends a simple GET request to the url with any potential parameters like Tokens or Basic Auth

func ReadCollection

func ReadCollection(c *cli.Context) (string, error)

ReadCollection reads the PostWoman Collection Json File and does the Magic Stuff

Types

type Bpardata

type Bpardata struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Bpardata hold the format of the bodyParams of `postwoman-collection.json`

type Colls

type Colls struct {
	Name    string    `json:"name"`
	Folders []string  `json:"folders"`
	Request []Reqdata `json:"requests"`
}

Colls hold the structure of the basic `postwoman-collection.json`

type Reqdata

type Reqdata struct {
	URL     string     `json:"url"`
	Path    string     `json:"path"`
	Method  string     `json:"method"`
	Auth    string     `json:"auth"`
	User    string     `json:"httpUser"`
	Pass    string     `json:"httpPassword"`
	Token   string     `json:"bearerToken"`
	Ctype   string     `json:"contentType"`
	Name    string     `json:"name"`
	Heads   []string   `json:"headers"`
	Params  []string   `json:"params"`
	Bparams []Bpardata `json:"bodyParams"`
}

Reqdata hold the format of the request part in `postwoman-collection.json`

Jump to

Keyboard shortcuts

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