Backoff Retry Mechanism with retry condition function reference.Request URL Path Params (aka URI Params).Easy to upload one or more file(s) via multipart/form-data.Resty provides an option to override JSON Marshal/Unmarshal and XML Marshal/Unmarshal.Supports RFC7807 - application/problem+json & application/problem+xml.Error scenario Request.SetError() and Response.Error().Success scenario Request.SetResult() and Response.Result().Default is JSON, if you supply struct/map without header Content-Type.Automatic marshal and unmarshal for JSON and XML content type.Know your response.Time() and when we response.ReceivedAt().Access as byte array - response.Body() OR Access as string - response.String().Response object gives you more possibility.Request Body can be read multiple times via ().Native *http.Request instance may be accessed during middleware and request execution via Request.RawRequest.Request Body can be string, byte, struct, map, slice and io.Reader too.Simple and chainable methods for settings and request.GET, POST, PUT, DELETE, HEAD, PATCH, OPTIONS, etc.Simple HTTP and REST client library for Go Features Support middleware before request sent and after got response (see Request and Response Middleware).Easy set timeout, proxy, certs, redirect policy, cookie jar, compression, keepalives etc for client.Easy set header, cookie, path parameter, query parameter, form data, basic auth, bearer token for both client and request level.Exportable Transport, easy to integrate with existing http.Client, debug APIs with minimal code change.Automatic marshal and unmarshal for JSON and XML content type and fully customizable (see Body and Marshal/Unmarshal).Detect the charset of response body and decode it to utf-8 automatically to avoid garbled characters by default (see Auto-Decode).Works fine with both HTTP/2 and HTTP/1.1, which HTTP/2 is preferred by default if server support, and you can also force HTTP/1.1 if you want (see HTTP2 and HTTP1).Easy making HTTP test with code instead of tools like curl or postman, req provide global wrapper methods and MustXXX to test API with minimal code (see Quick HTTP Test).Powerful and convenient debug utilites, including debug logs, performance traces, and even dump the complete request and response content (see Debugging - Dump/Log/Trace).Simple and chainable methods for both client-level and request-level settings, and the request-level setting takes precedence if both are set.Simple Go HTTP client with Black Magic Features
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |