mirror of
https://github.com/go-micro/go-micro.git
synced 2025-03-17 20:28:06 +02:00
22 lines
436 B
Python
22 lines
436 B
Python
import requests
|
|
import json
|
|
|
|
|
|
def main():
|
|
url = "http://localhost:8081/rpc"
|
|
headers = {'content-type': 'application/json'}
|
|
|
|
# Example echo method
|
|
payload = {
|
|
"service": "go.micro.srv.greeter",
|
|
"method": "Say.Hello",
|
|
"request": {"name": "John"},
|
|
}
|
|
response = requests.post(
|
|
url, data=json.dumps(payload), headers=headers).json()
|
|
|
|
print response
|
|
|
|
if __name__ == "__main__":
|
|
main()
|