Documentation ¶
Overview ¶
Package httputilx provides HTTP utility functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DumpBody ¶
DumpBody reads the body of a HTTP request without consuming it, so it can be read again later. It will read at most maxSize of bytes. Use -1 to read everything.
It's based on httputil.DumpRequest.
Copyright 2009 The Go Authors. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the LICENSE file: https://golang.org/LICENSE
func Fetch ¶
Fetch the contents of an HTTP URL.
This is not intended to cover all possible use cases for fetching files, only the most common ones. Use the net/http package for more advanced usage.
func Save ¶
Save an HTTP URL to the directory dir with the filename. The filename can be generated from the URL if empty.
It will return the full path to the save file. Note that it may create both a file *and* return an error (e.g. in cases of non-200 status codes).
This is not intended to cover all possible use cases for fetching files, only the most common ones. Use the net/http package for more advanced usage.