0

I think the spring-framework webdriver(MockMvcHtmlUnitDriver) testing doesn't support POST parameter passing(or encoding) correctly.

$.ajax(... method: 'POST', { data : {'param1' : 'param1Val', 'param2' : 'param2Val' } ...)

then server expect the param values but the results are null. (even the content-type header is not set correctly. Always */* not application/x-www-form-urlencoded)

How can I workaround this?

Anna
  • 1
  • 3
  • Are you sure the problem isnt with your endpoint? Does the endpoint behave as expected if you hit from postman for example? – Dingredient May 23 '16 at 04:30
  • Yes. As I mentioned, I'm using MockMvcHtmlUnitDriver that is HtmlUnit not any real browser. setup like this : driver = MockMvcHtmlUnitDriverBuilder .webAppContextSetup(context) .build(); – Anna May 23 '16 at 04:54

0 Answers0