-
-
Notifications
You must be signed in to change notification settings - Fork 729
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add SetDebug method at request level #651
- Loading branch information
Showing
4 changed files
with
25 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -711,11 +711,11 @@ func TestFormDataDisableWarn(t *testing.T) { | |
c := dc() | ||
c.SetFormData(map[string]string{"zip_code": "00000", "city": "Los Angeles"}). | ||
SetContentLength(true). | ||
SetDebug(true). | ||
SetDisableWarn(true) | ||
c.outputLogTo(io.Discard) | ||
|
||
resp, err := c.R(). | ||
SetDebug(true). | ||
SetFormData(map[string]string{"first_name": "Jeevanandam", "last_name": "M", "zip_code": "00001"}). | ||
SetBasicAuth("myuser", "mypass"). | ||
Post(ts.URL + "/profile") | ||
|
@@ -1748,14 +1748,15 @@ func TestPathParamURLInput(t *testing.T) { | |
ts := createGetServer(t) | ||
defer ts.Close() | ||
|
||
c := dc().SetDebug(true). | ||
c := dc(). | ||
SetBaseURL(ts.URL). | ||
SetPathParams(map[string]string{ | ||
"userId": "[email protected]", | ||
"path": "users/developers", | ||
}) | ||
|
||
resp, err := c.R(). | ||
SetDebug(true). | ||
SetPathParams(map[string]string{ | ||
"subAccountId": "100002", | ||
"website": "https://example.com", | ||
|
@@ -1900,7 +1901,8 @@ func TestDebugLoggerRequestBodyTooLarge(t *testing.T) { | |
|
||
// upload a text file with no more than 512 bytes | ||
output = bytes.NewBufferString("") | ||
resp, err = New().SetDebug(true).outputLogTo(output).SetDebugBodyLimit(debugBodySizeLimit).R(). | ||
resp, err = New().outputLogTo(output).SetDebugBodyLimit(debugBodySizeLimit).R(). | ||
SetDebug(true). | ||
SetFile("file", filepath.Join(getTestDataPath(), "text-file.txt")). | ||
SetHeader("Content-Type", "text/plain"). | ||
Post(ts.URL + "/upload") | ||
|
@@ -1927,7 +1929,8 @@ func TestDebugLoggerRequestBodyTooLarge(t *testing.T) { | |
|
||
// post form with no more than 512 bytes data | ||
output = bytes.NewBufferString("") | ||
resp, err = New().SetDebug(true).outputLogTo(output).SetDebugBodyLimit(debugBodySizeLimit).R(). | ||
resp, err = New().outputLogTo(output).SetDebugBodyLimit(debugBodySizeLimit).R(). | ||
SetDebug(true). | ||
SetFormData(map[string]string{ | ||
"first_name": "Alex", | ||
"last_name": "C", | ||
|
@@ -1954,7 +1957,8 @@ func TestDebugLoggerRequestBodyTooLarge(t *testing.T) { | |
|
||
// post slice with more than 512 bytes data | ||
output = bytes.NewBufferString("") | ||
resp, err = New().SetDebug(true).outputLogTo(output).SetDebugBodyLimit(debugBodySizeLimit).R(). | ||
resp, err = New().outputLogTo(output).SetDebugBodyLimit(debugBodySizeLimit).R(). | ||
SetDebug(true). | ||
SetBody([]string{strings.Repeat("C", int(debugBodySizeLimit))}). | ||
SetBasicAuth("myuser", "mypass"). | ||
Post(formTs.URL + "/profile") | ||
|