Documentation ¶
Index ¶
- func GetPageContent(url string) (content string, err error)
- func GetPageContentWithClient(url string, client Clientish) (content string, err error)
- func ReadResponseBody(resp *http.Response) (*[]byte, error)
- type Clientish
- type UserAgentClient
- func (u *UserAgentClient) Do(req *http.Request) (resp *http.Response, err error)
- func (u *UserAgentClient) Get(url string) (resp *http.Response, err error)
- func (u *UserAgentClient) Head(url string) (resp *http.Response, err error)
- func (u *UserAgentClient) Post(url string, bodyType string, body io.Reader) (resp *http.Response, err error)
- func (u *UserAgentClient) PostForm(url string, data url.Values) (resp *http.Response, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPageContent ¶
No fuss, no muss, just go get the content from this URL
func GetPageContentWithClient ¶
Also, but use the Clientish I supplied.
Types ¶
type Clientish ¶
type Clientish interface { Do(req *http.Request) (resp *http.Response, err error) Get(url string) (resp *http.Response, err error) Head(url string) (resp *http.Response, err error) Post(url string, bodyType string, body io.Reader) (resp *http.Response, err error) PostForm(url string, data url.Values) (resp *http.Response, err error) }
Mainly created to support the use of the simultaneous use of the
github.com/lumenlearning/go-utils/http/UserAgentClient and net/http/Client types.
Click to show internal directories.
Click to hide internal directories.