0
나는 the link을 따라 jsonrpc2를 시도합니다. 가 난 다음 실행jsonrpc에서 "method"를 정의하는 방법은 무엇입니까?
def greeting(name):
return dict(message="Hello, %s!" % name)
hello.py라는 이름의 파일이
runjsonrpc2 hello
내 코드는 서버가 응답을 가지고
import jsonrpc2
import requests
import json
url = "http://localhost:8080/"
headers = {'content-type': 'application/json'}
payload = {
"method": "greeting",
"params":{"name":"yy"},
"jsonrpc": "2.0",
"id":1.0,
}
response = requests.post(url, data=json.dumps(payload), headers=headers).json()
,하지만 난
u'error': {u'code': -32601, u'message': u'Method Not Found'}
있어
어떻게해야합니까? "방법"을 정의합니까?