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

GET working, PUT/POST etc not working with httpservlet HTTPService #404

Open
redemption95 opened this issue Oct 30, 2019 · 0 comments
Open

Comments

@redemption95
Copy link

redemption95 commented Oct 30, 2019

Hi Contributors,
I have redefined the Service method in my servlet class.

void HttpClientServlet::Service(HttpServletRequest &request, HttpServletResponse &response)
{
std::cout << "RequestUrl: " << request.GetRequestUrl() << std::endl;
std::cout << "RequestUri: " << request.GetRequestUri() << std::endl;
std::cout << "ContextPath: " << request.GetContextPath() << std::endl;
std::cout << "PathInfo: " << request.GetPathInfo() << std::endl;
std::cout << "ServletPath: " << request.GetServletPath() << std::endl;
std::cout << "Protocol: " << request.GetProtocol() << std::endl;
std::cout << "Scheme: " << request.GetScheme() << std::endl;
std::cout << "ServerName: " << request.GetServerName() << std::endl;
std::cout << "ServerPort: " << request.GetServerPort() << std::endl;
std::cout << "Method: " << request.GetMethod() << std::endl;
}

From postman (any other client) when I try to GET the service function responds with the following output :

Screenshot from 2019-10-30 19-14-23

But POST request output from postman seems to not find the URL:
Service function is not hitting
Screenshot from 2019-10-30 19-14-59

What's weird is the PUT request (seems to hit the framework httpservlet.cpp DoPut method (although I have my Service redefined) .. I am inferring this from the message :
Error 405: Method Not Allowed
PUT method not allowed )
Screenshot from 2019-10-30 19-17-28

What did I do wrong please help ? I need to get post & put working :( Thank you in advance

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