Documentation ¶
Index ¶
- Constants
- func AddURLQuery(reqURL string, key, value string) string
- func ContentTypeByUrl(httpUrl string) string
- func DeleteDataWithHeaders(reqURL string, reqHeader goHttp.Header) (goHttp.Header, []byte, error)
- func DownloadFile(reqURL string, filePath string) error
- func GetData(reqURL string) ([]byte, error)
- func GetDataWithHeaders(reqURL string, reqHeader goHttp.Header) (goHttp.Header, []byte, error)
- func GetJSON(url string, out interface{}) error
- func GetRequestBody(r *http.Request) []byte
- func GetRequestBodyAsMap(r *http.Request) map[string]interface{}
- func PostData(reqURL string, bodyType string, data []byte) ([]byte, error)
- func PostDataSsl(reqURL string, dataToSend, certPEMBlock, keyPEMBlock []byte) (respData []byte, err error)
- func PostDataWithHeaders(reqURL string, reqHeader goHttp.Header, bodyType string, data []byte, ...) (goHttp.Header, []byte, error)
- func PostFiles(reqURL string, values map[string][]string, progressReporter func(r int64)) (ret []byte, err error)
- func PostJSON(reqURL string, objToSend interface{}, out interface{}) error
- func PostXml(reqURL string, xmlToSend string, objReceived interface{}) (respData []byte, err error)
- func PutDataWithHeaders(reqURL string, reqHeader goHttp.Header, bodyType string, data []byte) (goHttp.Header, []byte, error)
- type ProgressReader
- type UploadFile
Constants ¶
View Source
const ( MIMEApplicationJSON = "application/json" MIMEApplicationJSONCharsetUTF8 = MIMEApplicationJSON + "; " + charsetUTF8 MIMEApplicationJavaScript = "application/javascript" MIMEApplicationJavaScriptCharsetUTF8 = MIMEApplicationJavaScript + "; " + charsetUTF8 MIMEApplicationXML = "application/xml" MIMEApplicationXMLCharsetUTF8 = MIMEApplicationXML + "; " + charsetUTF8 MIMETextXML = "text/xml" MIMETextXMLCharsetUTF8 = MIMETextXML + "; " + charsetUTF8 MIMEApplicationForm = "application/x-www-form-urlencoded" MIMEApplicationProtobuf = "application/protobuf" MIMEApplicationMsgpack = "application/msgpack" MIMETextHTML = "text/html" MIMETextHTMLCharsetUTF8 = MIMETextHTML + "; " + charsetUTF8 MIMETextPlain = "text/plain" MIMETextPlainCharsetUTF8 = MIMETextPlain + "; " + charsetUTF8 MIMEMultipartForm = "multipart/form-data" MIMEOctetStream = "application/octet-stream" MIMEImagePNG = "image/png" MIMEImageJpeg = "image/jpeg" MIMEVideoMp4 = "video/mp4" )
View Source
const ( ContentTypeApplicationJSON = "application/json" ContentTypeApplicationJSONCharsetUTF8 = ContentTypeApplicationJSON + "; " + charsetUTF8 ContentTypeApplicationJavaScript = "application/javascript" ContentTypeApplicationJavaScriptCharsetUTF8 = ContentTypeApplicationJavaScript + "; " + charsetUTF8 ContentTypeApplicationXML = "application/xml" ContentTypeApplicationXMLCharsetUTF8 = ContentTypeApplicationXML + "; " + charsetUTF8 ContentTypeTextXML = "text/xml" ContentTypeTextXMLCharsetUTF8 = ContentTypeTextXML + "; " + charsetUTF8 ContentTypeApplicationForm = "application/x-www-form-urlencoded" ContentTypeApplicationProtobuf = "application/protobuf" ContentTypeApplicationMsgpack = "application/msgpack" ContentTypeTextHTML = "text/html" ContentTypeTextHTMLCharsetUTF8 = ContentTypeTextHTML + "; " + charsetUTF8 ContentTypeTextPlain = "text/plain" ContentTypeTextPlainCharsetUTF8 = ContentTypeTextPlain + "; " + charsetUTF8 ContentTypeMultipartForm = "multipart/form-data" ContentTypeOctetStream = "application/octet-stream" ContentTypeImagePNG = "image/png" ContentTypeImageJpeg = "image/jpeg" ContentTypeVideoMp4 = "video/mp4" ContentTypeVideoWebm = "video/webm" ContentTypeVideoQuickTime = "video/quicktime" ContentTypeAudioMpeg = "audio/mpeg" ContentTypeAudioM4a = "audio/m4a" ContentTypeAudioOgg = "audio/ogg" ContentTypeAudioAmr = "audio/amr" ContentTypeAudioWav = "audio/x-wav" )
Variables ¶
This section is empty.
Functions ¶
func AddURLQuery ¶
func ContentTypeByUrl ¶
func DeleteDataWithHeaders ¶
func DownloadFile ¶
func GetDataWithHeaders ¶
func GetRequestBody ¶
func GetRequestBodyAsMap ¶
func PostDataSsl ¶
func PostDataWithHeaders ¶
Types ¶
type ProgressReader ¶
type UploadFile ¶
Click to show internal directories.
Click to hide internal directories.