Open
Description
Hi,
I want to use the library in my own Qt/QML project. I want to send a json command to an apache webserver which runs a php script. The script analyzes the method and send an answer.
So I did the following:
sp = new Sp(parent, "http://localhost:84/~martin/gc/rpcJSON.php");
consturctor of Sp:
Sp::Sp(QObject *parent, QString urlArg)
: QObject {parent}
, url(QUrl(urlArg))
{
rpcClient = new jcon::JsonRpcTcpClient(parent);
if (!rpcClient->connectToServer(url))
{
qDebug() << ">> SP > (Constructor) \t connecToServer fehlerhaft";
}
auto rpcResult = rpcClient->callAsync("getMaxSp");
QObject::connect(rpcResult.get(), &jcon::JsonRpcRequest::result, this, &Sp::msgRecieved);
QObject::connect(rpcResult.get(), &jcon::JsonRpcRequest::error, this, &Sp::msgError);
}
The library will send the following to the server:
{
"id": "0fce2d19-6b90-4ff6-ae0d-d45c045a055b",
"jsonrpc": "2.0",
"method": "getRandomInt",
"params": [
10
]
}
But the server will send a 400 bad request error.
What can I do to solve the problem?
Thank you for your help.
BR
martin
Metadata
Metadata
Assignees
Labels
No labels