stevetgates wrote:
This is the post request, which displays, what we post from a browser addin or the web service.
Hi maverick786us,@Steve, I just came up with this idea, but need your help and suggestion. If you take a look at this code.
You could perhaps try to identify the client making the request by the User Agent HTTP header, but this isn't guaranteed to work in all cases. The other option is assume it is a browser unless otherwise indicated and have the web service identify itself.
Steve
This is the post request, which displays, what we post from a browser addin or the web service.
listener.support(methods::POST,[](http_request req)
{
std::cout << "Serving POST" << std::endl;
req.extract_string(true).then([req](utility::string_t body)
{
std::wcout << body << std::endl;
std::wcout << "End of Body" << std::endl;
//req.reply(status_codes::OK, U("<html><body>Received.</body></html>"), U("text/html"));
});
});
So lets say, that when I am hitting the URL from we browser addin, I POST something else and while hitting the URL from web service, I POST something else and based on the condition that, what string was POSTED, I use it in GET method. But in order to accomplish this I hate to pass POST request first and then the GET response. What do you think of it?