Skip to content

GET handler does not work for URL?query #1003

Open
@akhlopotin

Description

@akhlopotin

GET handler does not recognize URI?query, e.g.
curl localhost:8050/v1/svcstatus?json=%7B%22file%22%3A%22myfile%227D

the handle_get does get called for the request above. what am i missing?

void handle_get(http_request message)
{
uri rel_uri = message.relative_uri();
string_t rel_uri_path = rel_uri.path();
ucout << rel_uri_path << endl;

if( rel_uri_path == U("svcstatus") ) {
ucout << message.request_uri().to_string() << endl;
ucout << rel_uri.query() << endl;
message.reply(status_codes::OK, "service is OK");
}
message.reply(status_codes::NotFound);
}

in main():

server.support(methods::GET, handle_get);

Metadata

Metadata

Assignees

No one assigned

    Labels

    experimental-listenersBug reports related to the experimental HTTP listeners.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions