mirror of
https://github.com/go-micro/go-micro.git
synced 2025-03-23 20:32:32 +02:00
38 lines
404 B
Markdown
38 lines
404 B
Markdown
# RPC API
|
|
|
|
This is an example of using an RPC based API
|
|
|
|
## Getting Started
|
|
|
|
### Run Micro API
|
|
|
|
```shell
|
|
micro api
|
|
```
|
|
|
|
### Run Greeter Service
|
|
|
|
```shell
|
|
go run greeter/srv/main.go
|
|
```
|
|
|
|
### Run Greeter API
|
|
|
|
```shell
|
|
go run rpc.go
|
|
```
|
|
|
|
### Curl API
|
|
|
|
```shell
|
|
curl -H 'Content-Type: application/json' -d '{"name": "Asim"}' http://localhost:8080/greeter/hello
|
|
```
|
|
|
|
Output
|
|
|
|
```
|
|
{
|
|
"msg": "Hello Asim"
|
|
}
|
|
```
|