EpsilonVector
EpsilonVector

Reputation: 4043

Getting post data from request

I'm writing a server side app in Java using the HttpCore library. I have an HttpRequest and I'm trying to get the postdata sent from a form. The problem is- when I use request.getEntity() it returns a null object, even though when I look through HTTPFox on what kind of request I'm sending the post data is clearly there.

What am I doing wrong?

Upvotes: 0

Views: 571

Answers (1)

Bozho
Bozho

Reputation: 597026

There seems to be some confusion. You are sending requests from a browser to the server. The server is likely using the servlet API. There you handle requests using the doPost(..) method of an HttpServlet. You have an HttpServletRequest from which you can get the parameters - request.getParameter("paramName")

HttpCore on the other hand is used to make requests, not to handle requests. It is used as an http client (in the role of the browser).

Upvotes: 2

Related Questions