0

I send data over post request to path which mount to:

public class AJAXPostPort extends ByteArrayResource implements IResource {
    ...
    @Override
    protected byte[] getData(Attributes attributes) {
        attributes.getRequest().getPostParameters(); <- EMPTY
        ...
    }
    ...
}

and can't get it :(. Request from client side is correct and catching from PHP.

Could you help me? how to catch post request from wicket module?

pushistic
  • 3,406
  • 3
  • 21
  • 35

1 Answers1

0

It was easy:

@Override
protected byte[] getData(Attributes attributes) {

    HttpServletRequest request; 
    request = (HttpServletRequest)attributes.getRequest().getContainerRequest();
    String data=null;
    try {
        data = IOUtils.toString( req.getInputStream()); <- GET REAL POST DATA
    } catch ( IOException e ) {
        e.printStackTrace();
    }
    ...
}
pushistic
  • 3,406
  • 3
  • 21
  • 35