Revert "initial attempt to integrate surf http client"

This reverts commit 538d52d064.
This commit is contained in:
2026-01-24 15:00:30 -06:00
parent 538d52d064
commit 8c85da5472
45 changed files with 109 additions and 196 deletions
+5 -8
View File
@@ -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"])