httpie_response

package
v0.2.93 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HttpieResponse

type HttpieResponse struct {
	Original  string                 `json:"original"` // original parsed response
	Status    string                 `json:"status"`   // response status
	Body      interface{}            `json:"body"`
	ElapsedMs int                    `json:"elapsed_ms"`
	Headers   map[string]interface{} `json:"headers"`
	Meta      map[string]interface{} `json:"meta"`
}

HttpieResponse HTTP/1.1 200 OK Date: Tue, 10 Oct 2023 16:09:27 GMT Content-Type: application/json Transfer-Encoding: chunked Connection: keep-alive Access-Control-Allow-Origin: * Access-Control-Allow-Credentials: true CF-Cache-Status: DYNAMIC Report-To: {"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=yYkZWLBEGyiCzs1Mm5G%2BnlHiK7QSR%2FJnYhPspJljdZpYYntKgsRSC%2BkcXfOGgenokNCOmrBIWnvyA%2FBG%2F2ffBtd3N%2BKNBNDgoKP1M0jihOS05IfLYhfhBuDl"}],"group":"cf-nel","max_age":604800} NEL: {"success_fraction":0,"report_to":"cf-nel","max_age":604800} Server: cloudflare CF-RAY: 814020bceefdbb06-MXP Content-Encoding: gzip alt-svc: h3=":443"; ma=86400

{
 "args": {},
 "data": "{\"name\": \"John\", \"surname\": \"foo\"}",
 "files": {},
 "form": {},
 "headers": {
   "Accept": "application/json, */*;q=0.5",
   "Accept-Encoding": "gzip",
   "Cdn-Loop": "cloudflare",
   "Cf-Connecting-Ip": "185.86.61.233",
   "Cf-Ipcountry": "SM",
   "Cf-Ray": "813e28201be8bab8-FRA",
   "Cf-Visitor": "{\"scheme\":\"http\"}",
   "Connection": "Keep-Alive",
   "Content-Length": "34",
   "Content-Type": "application/json",
   "Host": "pie.dev",
   "User-Agent": "HTTPie/3.2.2",
   "X-Api-Token": "123"
 },
 "json": {
   "name": "John",
   "surname": "foo"
 },
 "origin": "185.86.61.233",
 "url": "http://pie.dev/put"
}

func Parse

func Parse(s, printOptions string) (response *HttpieResponse, err error)

func (*HttpieResponse) String

func (instance *HttpieResponse) String() string

Jump to

Keyboard shortcuts

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