Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
ernesto27 committed Feb 12, 2024
1 parent 829af63 commit d6b8952
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ Support this protocos:

Using go
```bash
$ go install github.com/ernesto27/req@latest
go install github.com/ernesto27/req@latest
```

Using brew
```bash
$ brew install ernesto27/tools/req
brew install ernesto27/tools/req
```


Expand All @@ -25,44 +25,44 @@ $ brew install ernesto27/tools/req

GET
```bash
$ req -u http://example.com
req -u http://example.com
```

POST - send JSON body payload
```bash
$ req -m post -u https://jsonplaceholder.typicode.com/posts -p '{"title": "foo", "body": "bar", "userId": 1}'
req -m post -u https://jsonplaceholder.typicode.com/posts -p '{"title": "foo", "body": "bar", "userId": 1}'
```

POST - send form data
```bash
$ req -m post -u https://site.com -p "foo=bar&jhon=doe"
req -m post -u https://site.com -p "foo=bar&jhon=doe"
```

### Websocket

Listen for messages
```bash
$ req -t ws -u wss://socketsbay.com/wss/v2/1/demo/
req -t ws -u wss://socketsbay.com/wss/v2/1/demo/
```

Send message
```bash
$ req -t ws -p "some message" -u wss://socketsbay.com/wss/v2/1/demo/
req -t ws -p "some message" -u wss://socketsbay.com/wss/v2/1/demo/
```


### Graphql

Send query to graphql server
```bash
$ req . -t gq -u https://countries.trevorblades.com/ -p 'query {countries {name}}'
req -t gq -u https://countries.trevorblades.com/ -p 'query {countries {name}}'
```

### GRPC

Send request to grpc server
```bash
$ req -t grpc -u localhost:50051 -import-path /pathprotofiles/helloworld -proto helloworld.proto -p '{"name": "ernesto"}' -method helloworld.Greeter.SayHello
req -t grpc -u localhost:50051 -import-path /pathprotofiles/helloworld -proto helloworld.proto -p '{"name": "ernesto"}' -method helloworld.Greeter.SayHello
```


Expand Down

0 comments on commit d6b8952

Please sign in to comment.