Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add check timeout on retry #1

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ea77900
Merge branch 'release-0.2.15' into develop
parnurzeal Feb 20, 2017
8842d70
add a logger interface, and make the "logging" more flexible
caojia Apr 5, 2017
96c7975
Merge pull request #137 from caojia/develop
parnurzeal Apr 10, 2017
5da6857
Fixed nil reader content regression introduced with PR #129.
jaytaylor Mar 31, 2017
5ba0c85
Merge pull request #136 from jaytaylor/jay/nil-buffer-fix
parnurzeal Apr 19, 2017
640c2a7
Update README.md
Incisive Apr 25, 2017
f96b4cd
Add DoNotClearSuperAgent flag
roylou Apr 25, 2017
5bf13be
Merge pull request #139 from rv-rsmith/patch-1
parnurzeal Apr 29, 2017
476ec3a
Change SuperAgent.Header type to http.Header for support multiple val…
edentsai Aug 31, 2017
02a07d0
Fix typo in doc
Sep 1, 2017
798c9aa
Test force type to plain text
edentsai Aug 31, 2017
e352d76
Test force type to JSON
edentsai Aug 31, 2017
a13747a
Add type constants
edentsai Aug 31, 2017
8fd8a65
Merge pull request #155 from tleb/typo
parnurzeal Sep 27, 2017
2de487b
Merge pull request #154 from edentsai/use-http-header
parnurzeal Sep 30, 2017
06c4de0
Merge pull request #140 from roylou/develop
parnurzeal Sep 30, 2017
270e07c
Merge pull request #156 from edentsai/add-type-constants
parnurzeal Sep 30, 2017
290a1fe
Added doc for DoNotClearSuperAgent
empijei Oct 1, 2017
a4fdb89
Merge pull request #161 from empijei/develop
parnurzeal Oct 8, 2017
95984de
Don't infer header when set explicitly
harsimranmaan Oct 9, 2017
faf2e78
Remove minitests as they don't work with <go1.7
harsimranmaan Oct 9, 2017
219b5e0
Merge pull request #165 from harsimranmaan/infer_header
parnurzeal Oct 10, 2017
2221d42
updating some of the English
plod Oct 12, 2017
8e3aed2
Merge pull request #169 from plod/patch-1
parnurzeal Oct 15, 2017
26d39af
include timeout on retry
anthonyhartanto7 Aug 7, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ GoRequest -- Simplified HTTP client ( inspired by famous SuperAgent lib in Node.

#### "Shooting Requests like a Machine Gun" - Gopher

Sending request would never been fun and easier than this. It comes with lots of feature:
Sending request has never been as fun nor easier than this. It comes with lots of features:

* Get/Post/Put/Head/Delete/Patch/Options
* Set - simple header setting
Expand Down Expand Up @@ -59,7 +59,7 @@ Or below if you don't want to reuse it for other requests.
resp, body, errs := gorequest.New().Get("http://example.com/").End()
```

How about getting control over HTTP client headers, redirect policy, and etc. Things is getting more complicated in golang. You need to create a Client, setting header in different command, ... to do just only one __GET__
How about getting control over HTTP client headers, redirect policy, and etc. Things can quickly get more complicated in golang. You need to create a Client, set headers in a different command, ... just to do only one __GET__

```go
client := &http.Client{
Expand All @@ -72,7 +72,7 @@ req.Header.Add("If-None-Match", `W/"wyzzy"`)
resp, err := client.Do(req)
```

Why making things ugly while you can just do as follows:
Why make things ugly while you can just do it as follows:

```go
request := gorequest.New()
Expand All @@ -82,7 +82,7 @@ resp, body, errs := request.Get("http://example.com").
End()
```

__DELETE__, __HEAD__, __POST__, __PUT__, __PATCH__ are now supported and can be used the same way as __GET__:
__DELETE__, __HEAD__, __POST__, __PUT__, __PATCH__ are now supported and can be used in the same way as __GET__:

```go
request := gorequest.New()
Expand All @@ -95,7 +95,7 @@ resp, body, errs := request.Post("http://example.com").End()

### JSON

For a __JSON POST__ with standard libraries, you might need to marshal map data structure to json format, setting header to 'application/json' (and other headers if you need to) and declare http.Client. So, you code become longer and hard to maintain:
For a __JSON POST__ with standard libraries, you might need to marshal map data structure to json format, set headers to 'application/json' (and other headers if you need to) and declare http.Client. So, your code becomes longer and harder to maintain:

```go
m := map[string]interface{}{
Expand Down Expand Up @@ -242,7 +242,7 @@ Supposing you need retry 3 times, with 5 seconds between each attempt when gets
```go
request := gorequest.New()
resp, body, errs := request.Get("http://example.com/").
Retry(3, 5 * time.seconds, http.StatusBadRequest, http.StatusInternalServerError).
Retry(3, 5 * time.Second, http.StatusBadRequest, http.StatusInternalServerError).
End()
```

Expand Down
Loading