Documentation ¶
Overview ¶
Package client provides HTTP clients for accessing remote services.
Index ¶
- Variables
- func Get(ctx *b.Context, spec m.Map, addr string, params map[string][]string) string
- func GetAddress(ctx *b.Context, spec m.Map) string
- func GetAuth(ctx *b.Context, spec m.Map) m.Map
- func GetPath(ctx *b.Context, spec m.Map) string
- func PollStep(ctx *b.Context) (loop bool)
- func PostData(ctx *b.Context, spec m.Map, url string, pdata io.Reader) string
- func PostMessage(ctx *b.Context, spec m.Map, msg *b.Message) string
- func PostStream(ctx *b.Context, spec m.Map, msg *b.Message, pdata io.Reader) string
- func Send(ctx *b.Context, spec m.Map, rdata *RequestData) string
- func SendData(ctx *b.Context, spec m.Map, msg *b.Message)
- func SendMessage(ctx *b.Context, spec m.Map, msg *b.Message)
- func SetAuthentication(ctx *b.Context, spec m.Map, req *http.Request)
- func StartClient(ctx *b.Context)
- type ClientState
- type RequestData
Constants ¶
This section is empty.
Variables ¶
View Source
var GlobalCookieJar http.CookieJar
Functions ¶
func PostStream ¶ added in v0.1.13
func StartClient ¶ added in v0.1.8
Types ¶
type ClientState ¶ added in v0.1.8
type RequestData ¶ added in v0.1.15
type RequestData struct { Method string // GET, PUT, POST, PATCH, DELETE; default: GET Address string // URL base; default: take from config (ctx or spec) Path string // fixed part of path; default: take from config Prefix string // first part of variant path, e.g. container name Id string // second part, e.g. document ID Suffix string // third part Params map[string][]string // URL params, will be URL-encoded Payload interface{} // structured Post Data, will be rendered as JSON Postdata io.Reader // use directly, ignore Payload if != nil ContentType string // Content-type header, no default }
type RequestData allows simimplified and flexible set-up of requests for accessing foreign APIs via the Send() function.
Click to show internal directories.
Click to hide internal directories.