Documentation ¶
Overview ¶
The http package enables making remote HTTP requests.
var lib = require('http'); var res = lib.get('https://abcum.com'); res.pipe(context.res.body);
Or create a new HTTP request and specify custom HTTP options.
var fs = require('file'); var lib = require('http'); var req = lib.new('POST'); req.head("User-Agent", "Cirrius Bot"); req.timeout('30s'); req.url('https://example.com/uploader'); req.body( file.load('test.png') ); var res = req.do(); res.pipe(context.res.body);
Index ¶
- func New(orb *orbit.Orbit) interface{}
- type Module
- func (this *Module) Delete(url, head string) *stream.ReadCloser
- func (this *Module) Get(url string) *stream.ReadCloser
- func (this *Module) Head(url string) *stream.ReadCloser
- func (this *Module) New(method string) *Request
- func (this *Module) Patch(url, head string, body io.Reader) *stream.ReadCloser
- func (this *Module) Post(url, head string, body io.Reader) *stream.ReadCloser
- func (this *Module) Put(url, head string, body io.Reader) *stream.ReadCloser
- type Request
- func (this *Request) Auth(user, pass string) *Request
- func (this *Request) Body(req io.Reader) *Request
- func (this *Request) Do() *stream.ReadCloser
- func (this *Request) Head(key, val string) *Request
- func (this *Request) Method(met string) *Request
- func (this *Request) Timeout(dur *time.Duration) *Request
- func (this *Request) URL(url string) *Request
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Module ¶
type Module struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.