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

Enter image details here Do

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -