Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
test:
strategy:
matrix:
go: ['1.24.x', '1.25.x']
go: ['1.26.x']
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
Expand Down
2 changes: 1 addition & 1 deletion .testdata/sample-file.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
THIS IS A SAMPLE FILE FOR TEST

https://github.com/imroc/req
https://github.com/ennismore/req
50 changes: 25 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
<p align="center"><img src="https://req.cool/images/req.png"></p>
<p align="center"><strong>Simple Go HTTP client with Black Magic</strong></p>
<p align="center">
<a href="https://github.com/imroc/req/actions/workflows/ci.yml?query=branch%3Amaster"><img src="https://github.com/imroc/req/actions/workflows/ci.yml/badge.svg" alt="Build Status"></a>
<a href="https://goreportcard.com/report/github.com/imroc/req/v3"><img src="https://goreportcard.com/badge/github.com/imroc/req/v3" alt="Go Report Card"></a>
<a href="https://pkg.go.dev/github.com/imroc/req/v3"><img src="https://pkg.go.dev/badge/github.com/imroc/req/v3.svg"></a>
<a href="https://github.com/ennismore/req/actions/workflows/ci.yml?query=branch%3Amaster"><img src="https://github.com/ennismore/req/actions/workflows/ci.yml/badge.svg" alt="Build Status"></a>
<a href="https://goreportcard.com/report/github.com/ennismore/req/v3"><img src="https://goreportcard.com/badge/github.com/ennismore/req/v3" alt="Go Report Card"></a>
<a href="https://pkg.go.dev/github.com/ennismore/req/v3"><img src="https://pkg.go.dev/badge/github.com/ennismore/req/v3.svg"></a>
<a href="LICENSE"><img src="https://img.shields.io/github/license/imroc/req.svg" alt="License"></a>
<a href="https://github.com/imroc/req/releases"><img src="https://img.shields.io/github/v/release/imroc/req?display_name=tag&sort=semver" alt="GitHub Releases"></a>
<a href="https://github.com/ennismore/req/releases"><img src="https://img.shields.io/github/v/release/ennismore/req?display_name=tag&sort=semver" alt="GitHub Releases"></a>
<a href="https://github.com/avelino/awesome-go"><img src="https://awesome.re/mentioned-badge.svg" alt="Mentioned in Awesome Go"></a>
</p>
</p>
</p>

## Documentation
Expand Down Expand Up @@ -38,15 +38,15 @@ Full documentation is available on the official website: https://req.cool.
You first need [Go](https://go.dev/) installed (version 1.24+ is required), then you can use the below Go command to install req:

``` sh
go get github.com/imroc/req/v3
go get github.com/ennismore/req/v3
```

**Import**

Import req to your code:

```go
import "github.com/imroc/req/v3"
import "github.com/ennismore/req/v3"
```

**Basic Usage**
Expand All @@ -60,7 +60,7 @@ $ cat main.go
package main

import (
"github.com/imroc/req/v3"
"github.com/ennismore/req/v3"
)

func main() {
Expand All @@ -79,7 +79,7 @@ $ go run main.go
:method: GET
:path: /uuid
:scheme: https
user-agent: req/v3 (https://github.com/imroc/req/v3)
user-agent: req/v3 (https://github.com/ennismore/req/v3)
accept-encoding: gzip

:status: 200
Expand All @@ -97,7 +97,7 @@ access-control-allow-credentials: true
2022/05/19 10:05:09.340974 DEBUG [req] HTTP/1.1 GET https://httpbin.org/uuid
GET /uuid HTTP/1.1
Host: httpbin.org
User-Agent: req/v3 (https://github.com/imroc/req/v3)
User-Agent: req/v3 (https://github.com/ennismore/req/v3)
Accept-Encoding: gzip

HTTP/1.1 200 OK
Expand Down Expand Up @@ -136,7 +136,7 @@ package main

import (
"fmt"
"github.com/imroc/req/v3"
"github.com/ennismore/req/v3"
"log"
)

Expand Down Expand Up @@ -164,7 +164,7 @@ package main

import (
"fmt"
"github.com/imroc/req/v3"
"github.com/ennismore/req/v3"
"log"
"time"
)
Expand Down Expand Up @@ -232,7 +232,7 @@ package main

import (
"fmt"
"github.com/imroc/req/v3"
"github.com/ennismore/req/v3"
"log"
"time"
)
Expand Down Expand Up @@ -296,7 +296,7 @@ package main

import (
"fmt"
"github.com/imroc/req/v3"
"github.com/ennismore/req/v3"
"log"
)

Expand All @@ -314,7 +314,7 @@ func main() {
var result Result

resp, err := client.R().
SetBody(&Repo{Name: "req", Url: "https://github.com/imroc/req"}).
SetBody(&Repo{Name: "req", Url: "https://github.com/ennismore/req"}).
SetSuccessResult(&result).
Post("https://httpbin.org/post")
if err != nil {
Expand All @@ -337,12 +337,12 @@ func main() {
:method: POST
:path: /post
:scheme: https
user-agent: req/v3 (https://github.com/imroc/req/v3)
user-agent: req/v3 (https://github.com/ennismore/req/v3)
content-type: application/json; charset=utf-8
content-length: 55
accept-encoding: gzip

{"name":"req","website":"https://github.com/imroc/req"}
{"name":"req","website":"https://github.com/ennismore/req"}

:status: 200
date: Thu, 19 May 2022 12:11:00 GMT
Expand All @@ -354,27 +354,27 @@ access-control-allow-credentials: true

{
"args": {},
"data": "{\"name\":\"req\",\"website\":\"https://github.com/imroc/req\"}",
"data": "{\"name\":\"req\",\"website\":\"https://github.com/ennismore/req\"}",
"files": {},
"form": {},
"headers": {
"Accept-Encoding": "gzip",
"Content-Length": "55",
"Content-Type": "application/json; charset=utf-8",
"Host": "httpbin.org",
"User-Agent": "req/v3 (https://github.com/imroc/req/v3)",
"User-Agent": "req/v3 (https://github.com/ennismore/req/v3)",
"X-Amzn-Trace-Id": "Root=1-628633d4-7559d633152b4307288ead2e"
},
"json": {
"name": "req",
"website": "https://github.com/imroc/req"
"website": "https://github.com/ennismore/req"
},
"origin": "103.7.29.30",
"url": "https://httpbin.org/post"
}

++++++++++++++++++++++++++++++++++++++++++++++++
data: {"name":"req","url":"https://github.com/imroc/req"}
data: {"name":"req","url":"https://github.com/ennismore/req"}
++++++++++++++++++++++++++++++++++++++++++++++++
```

Expand All @@ -387,7 +387,7 @@ package main

import (
"fmt"
"github.com/imroc/req/v3"
"github.com/ennismore/req/v3"
)

type APIResponse struct {
Expand Down Expand Up @@ -425,7 +425,7 @@ Here is an example of building GitHub's SDK with req, using two styles (`GetUser
import (
"context"
"fmt"
"github.com/imroc/req/v3"
"github.com/ennismore/req/v3"
)

type ErrorMessage struct {
Expand Down Expand Up @@ -502,13 +502,13 @@ func (c *GithubClient) GetUserProfile_Style2(ctx context.Context, username strin

## Contributing

If you have a bug report or feature request, you can [open an issue](https://github.com/imroc/req/issues/new), and [pull requests](https://github.com/imroc/req/pulls) are also welcome.
If you have a bug report or feature request, you can [open an issue](https://github.com/ennismore/req/issues/new), and [pull requests](https://github.com/ennismore/req/pulls) are also welcome.

## Contact

If you have questions, feel free to reach out to us in the following ways:

* [Github Discussion](https://github.com/imroc/req/discussions)
* [Github Discussion](https://github.com/ennismore/req/discussions)
* [Slack](https://imroc-req.slack.com/archives/C03UFPGSNC8) | [Join](https://slack.req.cool/)

## Sponsors
Expand Down
8 changes: 4 additions & 4 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ import (
utls "github.com/refraction-networking/utls"
"golang.org/x/net/publicsuffix"

"github.com/imroc/req/v3/http2"
"github.com/imroc/req/v3/internal/header"
"github.com/imroc/req/v3/internal/util"
"github.com/ennismore/req/v3/http2"
"github.com/ennismore/req/v3/internal/header"
"github.com/ennismore/req/v3/internal/util"

"github.com/google/go-querystring/query"
)
Expand Down Expand Up @@ -557,7 +557,7 @@ func (c *Client) DevMode() *Client {
}

// SetScheme set the default scheme for client, will be used when
// there is no scheme in the request URL (e.g. "github.com/imroc/req").
// there is no scheme in the request URL (e.g. "github.com/ennismore/req").
func (c *Client) SetScheme(scheme string) *Client {
if !util.IsStringEmpty(scheme) {
c.scheme = strings.TrimSpace(scheme)
Expand Down
2 changes: 1 addition & 1 deletion client_impersonate.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"strconv"
"strings"

"github.com/imroc/req/v3/http2"
"github.com/ennismore/req/v3/http2"
utls "github.com/refraction-networking/utls"
)

Expand Down
4 changes: 2 additions & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"testing"
"time"

"github.com/imroc/req/v3/internal/header"
"github.com/imroc/req/v3/internal/tests"
"github.com/ennismore/req/v3/internal/header"
"github.com/ennismore/req/v3/internal/tests"
"golang.org/x/net/publicsuffix"
)

Expand Down
2 changes: 1 addition & 1 deletion client_wrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net/url"
"time"

"github.com/imroc/req/v3/http2"
"github.com/ennismore/req/v3/http2"
utls "github.com/refraction-networking/utls"
)

Expand Down
3 changes: 2 additions & 1 deletion decode.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package req

import (
"github.com/imroc/req/v3/internal/charsets"
"io"
"strings"

"github.com/ennismore/req/v3/internal/charsets"
)

var textContentTypes = []string{"text", "json", "xml", "html", "java"}
Expand Down
3 changes: 2 additions & 1 deletion decode_test.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package req

import (
"github.com/imroc/req/v3/internal/tests"
"testing"

"github.com/ennismore/req/v3/internal/tests"
)

func TestPeekDrain(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion digest.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import (
"net/http"
"sync"

"github.com/ennismore/req/v3/internal/header"
"github.com/icholy/digest"
"github.com/imroc/req/v3/internal/header"
)

// cchal is a cached challenge and the number of times it's been used.
Expand Down
3 changes: 2 additions & 1 deletion dump.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
package req

import (
"github.com/imroc/req/v3/internal/dump"
"io"
"os"

"github.com/ennismore/req/v3/internal/dump"
)

// DumpOptions controls the dump behavior.
Expand Down
4 changes: 0 additions & 4 deletions examples/README.md

This file was deleted.

17 changes: 0 additions & 17 deletions examples/find-popular-repo/README.md

This file was deleted.

27 changes: 0 additions & 27 deletions examples/find-popular-repo/go.mod

This file was deleted.

44 changes: 0 additions & 44 deletions examples/find-popular-repo/go.sum

This file was deleted.

Loading