Back to godoc.org

Package methods

v0.0.5
Latest Go to latest
Published: Feb 16, 2020 | License: MIT | Module: github.com/athul/pwcli

Index

Package Files

Variables

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

func BasicRequestWithBody

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

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`

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier