I'm trying to send a JSON RPC request to an OpenEMS Edge instance from a python script, but am getting a 503 error in response. I know the Edge instance is fine because a JSONRPC request from Postman works.
My Postman API call:
POST: http://localhost:8084/jsonrpc
Added headers: Basic Authorisation header
Body:
{ "method": "getEdgeConfig",
"params": {}
}
Returns a valid json.
The same in python returns an error:
url='http://localhost:8084/jsonrpc'
headers = {'Authorization': 'Basic YWRtaW46YWRtaW4=',
'Accept': '*/*',
'Content-Type': 'application/json',
}
body = {"method": "getEdgeConfig",
"params": {}
}
response = requests.post(url, headers=headers, json=body)
Returns a 503: Service Unavailable status