Hello, I am using the library on Win x64 with MingW, I installed restbed and asio using MSYS2 packages and the example compiles and runs, but then I try to navigate to http:://localhost:8080/resource using Chrome a 501 is returned.
You've set an HTTP POST method handler, Chrome will issue an HTTP GET request. This won't be found and is not implemented anywhere else on the service hence the 501.
Hello, I am using the library on Win x64 with MingW, I installed restbed and asio using MSYS2 packages and the example compiles and runs, but then I try to navigate to http:://localhost:8080/resource using Chrome a 501 is returned.
compile/link command: g++ -O3 -std=c++20 restbed.cpp -o restbed.exe -lrestbed
Any help is much appreciated. Regards, Martin
The code:
include
include
include
using namespace std; using namespace restbed;
void post_method_handler( const shared_ptr< Session > session ) { const auto request = session->get_request( );
}
int main( const int, const char** ) { auto resource = make_shared< Resource >( ); resource->set_path( "/resource" ); resource->set_method_handler( "POST", post_method_handler );
}