Documentation ¶
Overview ¶
Package request provides a request object for accessing websites.
Index ¶
- type Request
- func (req *Request) Close()
- func (req *Request) Context() context.Context
- func (req *Request) Document() (*goquery.Document, error)
- func (req *Request) Request() *http.Request
- func (req *Request) Reset()
- func (req *Request) Response() (*http.Response, error)
- func (req *Request) Text() (string, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Request ¶
type Request struct { URL string // contains filtered or unexported fields }
Request is a wrapper around a url which makes it easy to access the data it points to.
func NewWithContext ¶
NewWithContext creates a new request with the given context. Note that nil is a valid context.
func (*Request) Close ¶
func (req *Request) Close()
Close performs cleanup for the Request. This is a no-op if the Request doesn't need cleanup
func (*Request) Document ¶
Document returns a goquery.Document for the Request.Response The Document is internally cached.
func (*Request) Request ¶
Request creates an http.Request (GET) for the url and returns it. The request is internally cached so calling this method multiple times will return the same http.Request.
func (*Request) Reset ¶
func (req *Request) Reset()
Reset closes the request and removes all cached data.