Cheatography
https://cheatography.com
CLI and IDE plugin to test REST API, GraphQL, gRPC, Kafka Pub/Sub services with HTTP DSL
Where to load http file?
1. Assigned by --justfile option |
2. Find index.http in current directory |
3. Try to find index.http in parent dir util to root |
4. Load default $HOME/.httpx/index.http |
Test services in htttp file
$ httpx --list
$ httpx myip
$ echo hello | httpx post
$ httpx post --data @/path/to/file
|
Zsh completion
$ httpx --completions zsh
|
Generate HTTP file from OpenAPI
|
|
gRPC
### grpc call SayHello
//@name SayHello
GRPC localhost:50052/Greeter/SayHello
{
"name": "Jackie"
}
|
GraphQL
### graphql query
GRAPHQL https://countries.trevorblades.com/
Content-Type: application/graphql
query { continents { name } }
### graphql query over WebSocket
GRAPHQL ws://localhost:4000/graphql
Content-Type: application/graphql
subscription { greetings }
### graphql over RSocket
GRAPHQL rsocketws://localhost:8080/rsocket/graphql
Content-Type: application/graphql
query { continents { name } }
|
RSocket
### RSocket Request
// @name rsocket-request
RSOCKET com.example.UserService.findById
Host: 127.0.0.1:42252
Content-Type: application/json
1
### RSocket Request
//@name rsocket-stream
STREAM com.example.UserService.findAll
Host: ws://127.0.0.1:8080/rsocket
Content-Type: application/json
"vip"
|
Apache Dubbo
### Dubbo sayHi
//@name sayHi
DUBBO 127.0.0.1:20880/GreetingsService/sayHi(java.lang.String)
Content-Type: application/json
"jackie"
|
ZeroMQ
### zeromq request
//@name zero-req
ZEROREQ 127.0.0.1:5555
Content-Type: application/json
"Jackie"
### subscribe zeromq
//@name zero-sub
SUB topic1
Host: zeromq://localhost:5555
|
Apache Thrift
### thrift request
THRIFT 127.0.0.1:9090/getUser
Content-Type: application/json
{
"1": {"i32": 1}
}
|
|
|
Kafka
### publish kafka message
//@name kafka-pub
PUB topic-1
Host: kafka://localhost:9092
Content-Type: application/json
{
"name": "Jackie"
}
### subscribe kafka topic
//@name kafka-sub
SUB topic-1
Host: kafka://localhost:9092
|
Apache Pulsar
### publish kafka message
//@name pulsar-pub
PUB topic-1
Host: pulsar://localhost:6650
Content-Type: application/json
{
"name": "Jackie"
}
### subscribe Pulsar topic
//@name pulsar-sub
SUB topic-1
Host: pulsar://localhost:6650
|
RabbitMQ
### publish RabbitMQ message
//@name rabbit-pub
PUB queue1
Host: amqp://localhost:5672
Content-Type: application/json
{
"name": "Jackie"
}
### Subscribe RabbitMQ queue
//@name rabbit-sub
SUB queue1
Host: amqp://localhost:5672
|
Redis Pub/Sub
### publish redis message
//@name redis-pub
PUB channel1
Host: redis://localhost:6379
Content-Type: application/json
{
"name": "Jackie"
}
### subscribe redis
//@name redis-sub
SUB channel1
Host: redis://localhost:6379
|
Pub/Sub more
* Nats
* AMQP, MQTT, Stomp
* Aliyun MNS/EventBridge
* AWS SNS/SQS/EventBridge
|
|
Created By
Metadata
Comments
No comments yet. Add yours below!
Add a Comment
Related Cheat Sheets
More Cheat Sheets by linux_china