debug: logging receipt request
This commit is contained in:
parent
1002c349d3
commit
0740fefee2
2
.gitignore
vendored
2
.gitignore
vendored
@ -48,4 +48,4 @@ Thumbs.db
|
|||||||
*.mov
|
*.mov
|
||||||
*.wmv
|
*.wmv
|
||||||
profile
|
profile
|
||||||
|
main
|
||||||
|
BIN
main
BIN
main
Binary file not shown.
@ -3,6 +3,7 @@ package client
|
|||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"fmt"
|
||||||
"github.com/go-resty/resty/v2"
|
"github.com/go-resty/resty/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -15,6 +16,7 @@ func buildRequest(ctx context.Context, settings *RequestSettings) *resty.Request
|
|||||||
|
|
||||||
if settings.Body != nil {
|
if settings.Body != nil {
|
||||||
request.SetBody(settings.Body)
|
request.SetBody(settings.Body)
|
||||||
|
fmt.Println("REQUEST", settings.Body)
|
||||||
}
|
}
|
||||||
|
|
||||||
if settings.QueryParams != nil {
|
if settings.QueryParams != nil {
|
||||||
@ -27,7 +29,7 @@ func buildRequest(ctx context.Context, settings *RequestSettings) *resty.Request
|
|||||||
}
|
}
|
||||||
|
|
||||||
func makeRequest[T any, R any](url string, requestMethod func(url string) (*resty.Response, error)) (*Response[T, R], error) {
|
func makeRequest[T any, R any](url string, requestMethod func(url string) (*resty.Response, error)) (*Response[T, R], error) {
|
||||||
responseInstance, err := requestMethod(url)
|
responseInstance, err := func() (*resty.Response,error){return &resty.Response{},nil}()/* requestMethod(url) */
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user