Merge pull request #262 from mdanzinger/master
remove ResolveReference call
This commit is contained in:
commit
97ac73b1d5
4
godo.go
4
godo.go
|
@ -227,13 +227,11 @@ func SetUserAgent(ua string) ClientOpt {
|
||||||
// BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the
|
// BaseURL of the Client. Relative URLS should always be specified without a preceding slash. If specified, the
|
||||||
// value pointed to by body is JSON encoded and included in as the request body.
|
// value pointed to by body is JSON encoded and included in as the request body.
|
||||||
func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error) {
|
func (c *Client) NewRequest(ctx context.Context, method, urlStr string, body interface{}) (*http.Request, error) {
|
||||||
rel, err := url.Parse(urlStr)
|
u, err := c.BaseURL.Parse(urlStr)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
u := c.BaseURL.ResolveReference(rel)
|
|
||||||
|
|
||||||
buf := new(bytes.Buffer)
|
buf := new(bytes.Buffer)
|
||||||
if body != nil {
|
if body != nil {
|
||||||
err = json.NewEncoder(buf).Encode(body)
|
err = json.NewEncoder(buf).Encode(body)
|
||||||
|
|
Loading…
Reference in New Issue