Revert "initial attempt to integrate surf http client"
This reverts commit 538d52d064.
This commit is contained in:
+5
-8
@@ -6,15 +6,16 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/enetx/http"
|
||||
"io"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"os"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/google/go-querystring/query"
|
||||
"golang.org/x/net/context/ctxhttp"
|
||||
)
|
||||
|
||||
// EmojiService handles communication with the emoji
|
||||
@@ -241,18 +242,14 @@ func (s *EmojiService) Upload(ctx context.Context, subreddit string, createReque
|
||||
return nil, err
|
||||
}
|
||||
|
||||
req, err := http.NewRequest(http.MethodPost, uploadURL, body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resp, err = s.client.Do(ctx, req, nil)
|
||||
httpResponse, err := ctxhttp.Post(ctx, nil, uploadURL, writer.FormDataContentType(), body)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = CheckResponse(resp.Response)
|
||||
err = CheckResponse(httpResponse)
|
||||
if err != nil {
|
||||
return newResponse(resp.Response), err
|
||||
return newResponse(httpResponse), err
|
||||
}
|
||||
|
||||
return s.upload(ctx, subreddit, createRequest, fields["key"])
|
||||
|
||||
Reference in New Issue
Block a user