Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

ofxHTTP post response

$
0
0

@pandereto wrote:

Hi

Im trying to do an jsonrpc using POST, im taking the simplePostServer as starting point. To the jsonrpc part im using https://github.com/uskr/jsonrpc-lean to parse the json data and handle request....

Im doing this

void ofApp::onHTTPPostEvent(ofx::HTTP::PostEventArgs& args)
{
    ofLogNotice("ofApp::onHTTPPostEvent") << "Data: " << args.getBuffer().getText();

    std::shared_ptr<jsonrpc::FormattedData> outputFormattedData;

    outputFormattedData.reset();

    std::cout << "request: " << args.getBuffer().getText() << std::endl;

    outputFormattedData = server.HandleRequest(args.getBuffer().getText());

    std::cout << "response: " << outputFormattedData->GetData() << std::endl;
}

but the server try to redirect to a html file "uploaded.html"

FileSystemRoute::handleRequest: File not found: ...... myApps/ProbaJsonRPC/bin/data/DocumentRoot/uploaded.html

Why it handle like if im uploading anything??¿¿ I only want to call postEvent not uploadEvent.... I tried to find where the code redirects to "upload part" but i can not see where it will be.

I know that a ofxJsonRpc exist but i need to use with an http post server not with websockets.

Best!

Posts: 6

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 4929

Trending Articles