Documentation ¶
Index ¶
Constants ¶
View Source
const ( MethodGet = "GET" MethodHead = "HEAD" MethodPost = "POST" MethodPut = "PUT" MethodPatch = "PATCH" MethodDelete = "DELETE" MethodConnect = "CONNECT" MethodOptions = "OPTIONS" MethodTrace = "TRACE" MIMEApplicationJSON = "application/json" MIMEApplicationJavaScript = "application/javascript" MIMEApplicationXML = "application/xml" MIMETextXML = "text/xml" MIMEApplicationForm = "application/x-www-form-urlencoded" MIMEApplicationProtobuf = "application/protobuf" MIMEApplicationMsgpack = "application/msgpack" MIMETextHTML = "text/html" MIMETextPlain = "text/plain" MIMEMultipartForm = "multipart/form-data" MIMEOctetStream = "application/octet-stream" )
View Source
const (
DefaultTimeout = 5 * time.Second
)
View Source
const (
ErrUnsupportedMethod = rserrors.Error("Unsupported method")
)
Variables ¶
View Source
var ( MIMEApplicationJSONCharsetUTF8 = appendUTF8IntoMIME(MIMEApplicationJSON) MIMEApplicationJavaScriptCharsetUTF8 = appendUTF8IntoMIME(MIMEApplicationJavaScript) MIMEApplicationXMLCharsetUTF8 = appendUTF8IntoMIME(MIMEApplicationXML) MIMETextXMLCharsetUTF8 = appendUTF8IntoMIME(MIMETextXML) MIMETextHTMLCharsetUTF8 = appendUTF8IntoMIME(MIMETextHTML) MIMETextPlainCharsetUTF8 = appendUTF8IntoMIME(MIMETextPlain) )
Functions ¶
This section is empty.
Types ¶
type ContentType ¶
type ContentType string
func (ContentType) GetBodyFromResponse ¶
func (contentType ContentType) GetBodyFromResponse(res *http.Response) (interface{}, error)
func (ContentType) String ¶
func (contentType ContentType) String() string
func (ContentType) Validate ¶
func (contentType ContentType) Validate() error
type EndpointPath ¶
type EndpointPath string
func (EndpointPath) String ¶
func (endpointPath EndpointPath) String() string
func (EndpointPath) Validate ¶
func (endpointPath EndpointPath) Validate() error
type Request ¶
type Request struct { Method string RawUrl string Header req.Header Query req.QueryParam ContentType ContentType Body rsjson.MapJson Timeout Timeout }
Click to show internal directories.
Click to hide internal directories.