java - How to test a JAX-RS @POST -
How can I test a @ POST method?
It is easy to test @ to use the URL, how can I do this for POSTs? Do you really need to submit a form?
Programmatic? Something like this:
string data = urlcoder.x code ("key1", "utf-8") + "=" + url encoder.x code ("value1", "utf- 8 "); Data + = "& amp;" + URLEncoder.encode ("key2", "UTF-8") + "=" + URLEncoder.encode ("value2", "UTF-8"); // data url url = Send new URL ("http: // hostname 80 / urlhosthost"); URL Connection Connection = url.openConnection (); Conn.setDoOutput (right); OutputStream Vector wr = New OutputStream Water (conn.getOutputStream ()); Wr.write (data); Wr.flush (); Interactive? You can use SoapUI (free edition) to do this
Comments
Post a Comment