Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad Request error from apache server #80

Open
msauer75 opened this issue Jan 2, 2025 · 0 comments
Open

Bad Request error from apache server #80

msauer75 opened this issue Jan 2, 2025 · 0 comments

Comments

@msauer75
Copy link

msauer75 commented Jan 2, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant