Documentation ¶
Index ¶
- type Sling
- func (s *Sling) AddHeader(key, value string) *Sling
- func (s *Sling) AddQueries(qs ...interface{}) *Sling
- func (s *Sling) AddQuery(q interface{}) *Sling
- func (s *Sling) BaseURL(baseURL string) *Sling
- func (s *Sling) BodyForm(data interface{}) *Sling
- func (s *Sling) BodyJSON(data interface{}) *Sling
- func (s *Sling) BodyProvider(bodyProvider slinghttp.BodyProvider) *Sling
- func (s *Sling) Clone() (*Sling, error)
- func (s *Sling) Connect(pathURL string) *Sling
- func (s *Sling) Delete(pathURL string) *Sling
- func (s *Sling) Get(pathURL string) *Sling
- func (s *Sling) HTTPClient(client slinghttp.Client) *Sling
- func (s *Sling) Head(pathURL string) *Sling
- func (s *Sling) Method(method, pathURL string) *Sling
- func (s *Sling) Options(pathURL string) *Sling
- func (s *Sling) Patch(pathURL string) *Sling
- func (s *Sling) PathURL(pathURL string) *Sling
- func (s *Sling) Post(pathURL string) *Sling
- func (s *Sling) Put(pathURL string) *Sling
- func (s *Sling) Receive(v interface{}) error
- func (s *Sling) Request() (*http.Request, error)
- func (s *Sling) ResponseDecoder(rspDecoder slinghttp.ResponseDecoder) *Sling
- func (s *Sling) SetHeader(key, value string) *Sling
- func (s *Sling) Trace(pathURL string) *Sling
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Sling ¶
type Sling struct {
// contains filtered or unexported fields
}
Sling is an HTTP request builder and response receiver
func (*Sling) AddQueries ¶ added in v1.4.0
func (*Sling) BodyProvider ¶
func (s *Sling) BodyProvider(bodyProvider slinghttp.BodyProvider) *Sling
func (*Sling) Clone ¶ added in v1.4.0
Clone return Sling with same values All values are copied except HTTP client so that change in the clone will not affect the original
func (*Sling) HTTPClient ¶ added in v1.4.0
HTTPClient set HTTP client Fallback to http.DefaultClient
func (*Sling) PathURL ¶ added in v1.6.0
PathURL add path URL to base URL Base URL: example.com Path URL: /users Result: example.com/users
func (*Sling) ResponseDecoder ¶ added in v1.4.0
func (s *Sling) ResponseDecoder(rspDecoder slinghttp.ResponseDecoder) *Sling
Click to show internal directories.
Click to hide internal directories.