| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 | package http_requestsimport "io"type HttpOptions struct {	Type  string	Value interface{}}// millisecondsfunc HttpWriteTimeout(timeout int64) HttpOptions {	return HttpOptions{"write_timeout", timeout}}// millisecondsfunc HttpReadTimeout(timeout int64) HttpOptions {	return HttpOptions{"read_timeout", timeout}}func HttpHeader(header map[string]string) HttpOptions {	return HttpOptions{"header", header}}// which is used for params with in urlfunc HttpParams(params map[string]string) HttpOptions {	return HttpOptions{"params", params}}// which is used for POST method onlyfunc HttpPayload(payload map[string]string) HttpOptions {	return HttpOptions{"payload", payload}}// which is used for POST method onlyfunc HttpPayloadText(payload string) HttpOptions {	return HttpOptions{"payloadText", payload}}// which is used for POST method onlyfunc HttpPayloadJson(payload interface{}) HttpOptions {	return HttpOptions{"payloadJson", payload}}type HttpPayloadMultipartFile struct {	Filename string	Reader   io.Reader}// which is used for POST method only// payload follows the form data format, and files is a map from filename to filefunc HttpPayloadMultipart(payload map[string]string, files map[string]HttpPayloadMultipartFile) HttpOptions {	return HttpOptions{"payloadMultipart", map[string]interface{}{		"payload": payload,		"files":   files,	}}}func HttpRaiseErrorWhenStreamDataNotMatch(raise bool) HttpOptions {	return HttpOptions{"raiseErrorWhenStreamDataNotMatch", raise}}func HttpWithDirectReferer() HttpOptions {	return HttpOptions{"directReferer", true}}func HttpWithRetCode(retCode *int) HttpOptions {	return HttpOptions{"retCode", retCode}}
 |