Skip to content

Commit

Permalink
chore(*): -
Browse files Browse the repository at this point in the history
  • Loading branch information
enenumxela committed Oct 20, 2024
1 parent 9aa471a commit 5b6cdb5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 17 deletions.
8 changes: 4 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ go 1.23.1

require (
dario.cat/mergo v1.0.1
github.com/hueristiq/hq-go-http v0.0.0-20241014121239-62e79a5b0581
github.com/hueristiq/hq-go-limiter v0.0.0-20241014121435-ad5ad6a707cd
github.com/hueristiq/hq-go-url v0.0.0-20241014121328-cbb5439a9021
github.com/hueristiq/hq-go-http v0.0.0-20241020113552-532feebd5687
github.com/hueristiq/hq-go-limiter v0.0.0-20241020114425-bdc49852dc29
github.com/hueristiq/hq-go-url v0.0.0-20241020144539-a9e1f60005ea
github.com/hueristiq/hqgolog v0.0.0-20230623113334-a6018965a34f
github.com/logrusorgru/aurora/v3 v3.0.0
github.com/spf13/cast v1.7.0
Expand All @@ -22,7 +22,7 @@ require (
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hueristiq/hq-go-retrier v0.0.0-20241014121125-09fff4c010e8 // indirect
github.com/hueristiq/hq-go-retrier v0.0.0-20241020110813-ef8a550b01d5 // indirect
github.com/hueristiq/hqgoutils v0.0.0-20231024005153-bd2c47932440 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
Expand Down
16 changes: 8 additions & 8 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/hueristiq/hq-go-http v0.0.0-20241014121239-62e79a5b0581 h1:5NmFYwuPCurGVjz0I/g7q998rp/X4vDPtLgr3pvrlQ0=
github.com/hueristiq/hq-go-http v0.0.0-20241014121239-62e79a5b0581/go.mod h1:HNq1LSRIFndL7YzB17UVatJxsbWQFZkaaJvJv5AYWX0=
github.com/hueristiq/hq-go-limiter v0.0.0-20241014121435-ad5ad6a707cd h1:PpHm0WsXI4CnGI86sJsDtLHdfTJVxOJ7WTlL1ofZUWY=
github.com/hueristiq/hq-go-limiter v0.0.0-20241014121435-ad5ad6a707cd/go.mod h1:n1ODyTZYMyUuOIQCqHZgvobG8zWY/gxQaGeMiSnUnZw=
github.com/hueristiq/hq-go-retrier v0.0.0-20241014121125-09fff4c010e8 h1:QOJMjzKftmhYZojjqe2RDbUQDH/TZSz8gZURgxbGypM=
github.com/hueristiq/hq-go-retrier v0.0.0-20241014121125-09fff4c010e8/go.mod h1:YkxIHoJHsL0wmzQ3tc0qz4UTr9q9eCicUt5RvMV//xw=
github.com/hueristiq/hq-go-url v0.0.0-20241014121328-cbb5439a9021 h1:mBTiyALF+hGfDd6/wi8ihy1P++vHzO0kqXfGch0JK28=
github.com/hueristiq/hq-go-url v0.0.0-20241014121328-cbb5439a9021/go.mod h1:oDQP/s9eYGtsTz7LrbCC9CKbq6TmfB9b7yAoPCIqqyQ=
github.com/hueristiq/hq-go-http v0.0.0-20241020113552-532feebd5687 h1:wbtQCCbsyYpI22jE6f7MH979yNpvMPy0vertuYq32p0=
github.com/hueristiq/hq-go-http v0.0.0-20241020113552-532feebd5687/go.mod h1:4cIeUJTM4gt2NgJ4jOZePenVWaY8337wB1pvsK6sYDs=
github.com/hueristiq/hq-go-limiter v0.0.0-20241020114425-bdc49852dc29 h1:5MT7d/clp5I73BvazJrF4A9IkcKDCkdhaPyqL7gQrjE=
github.com/hueristiq/hq-go-limiter v0.0.0-20241020114425-bdc49852dc29/go.mod h1:n1ODyTZYMyUuOIQCqHZgvobG8zWY/gxQaGeMiSnUnZw=
github.com/hueristiq/hq-go-retrier v0.0.0-20241020110813-ef8a550b01d5 h1:uSIqfeqkXZI/QciepvLVduqbU7Rq+jr+At0ENVjPIN4=
github.com/hueristiq/hq-go-retrier v0.0.0-20241020110813-ef8a550b01d5/go.mod h1:YkxIHoJHsL0wmzQ3tc0qz4UTr9q9eCicUt5RvMV//xw=
github.com/hueristiq/hq-go-url v0.0.0-20241020144539-a9e1f60005ea h1:aFUvZ+Bnae4Coo97oThYy6OmuIwEkrQNGesMzAidedc=
github.com/hueristiq/hq-go-url v0.0.0-20241020144539-a9e1f60005ea/go.mod h1:1q7KVF3MOodsQzUkWwDwqn62L0Yjj8nLDSqZF0oirgQ=
github.com/hueristiq/hqgolog v0.0.0-20230623113334-a6018965a34f h1:JAgZOIJ+UbkENpRiOTlfg51CW0UNrUkgwLjUGiH+x9g=
github.com/hueristiq/hqgolog v0.0.0-20230623113334-a6018965a34f/go.mod h1:S5J3E3Azva5+JKv67uc+Hh3XwLDvkVYDGjEaMTFrIqg=
github.com/hueristiq/hqgoutils v0.0.0-20231024005153-bd2c47932440 h1:dpHAa9c74HgAXkZ2WPd84q2cCiF76eluuSGRw7bk7To=
Expand Down
9 changes: 4 additions & 5 deletions pkg/httpclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ func httpRequestWrapper(req *hqgohttp.Request) (res *http.Response, err error) {
return
}

// HTTPRequest makes any HTTP request to a URL with extended parameters
// HTTPRequest makes any HTTP request to a URL with extended parameters.
func HTTPRequest(method, requestURL, cookies string, headers map[string]string, body io.Reader) (*http.Response, error) {
req, err := hqgohttp.NewRequest(method, requestURL, body)
if err != nil {
Expand All @@ -49,7 +49,6 @@ func HTTPRequest(method, requestURL, cookies string, headers map[string]string,
req.Header.Set("Accept", "*/*")
req.Header.Set("Accept-Language", "en")
req.Header.Set("User-Agent", fmt.Sprintf("%s v%s (https://github.com/hueristiq/%s)", configuration.NAME, configuration.VERSION, configuration.NAME))
// req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:130.0) Gecko/20100101 Firefox/130.0")

if cookies != "" {
req.Header.Set("Cookie", cookies)
Expand All @@ -62,17 +61,17 @@ func HTTPRequest(method, requestURL, cookies string, headers map[string]string,
return httpRequestWrapper(req)
}

// Get makes a GET request to a URL with extended parameters
// Get makes a GET request to a URL with extended parameters.
func Get(URL, cookies string, headers map[string]string) (*http.Response, error) {
return HTTPRequest(methods.Get, URL, cookies, headers, nil)
}

// SimpleGet makes a simple GET request to a URL
// SimpleGet makes a simple GET request to a URL.
func SimpleGet(URL string) (*http.Response, error) {
return HTTPRequest(methods.Get, URL, "", map[string]string{}, nil)
}

// Post makes a POST request to a URL with extended parameters
// Post makes a POST request to a URL with extended parameters.
func Post(URL, cookies string, headers map[string]string, body io.Reader) (*http.Response, error) {
return HTTPRequest(methods.Post, URL, cookies, headers, body)
}
Expand Down

0 comments on commit 5b6cdb5

Please sign in to comment.