Forums Register Login

Sending parameters from servlets to URL via POST

+Pie Number of slices to send: Send
The task is pretty simple. We just need to send some parameter values to a listener port on an URL via POST from the servlet. But for some reasons I can't get it to work. Is there anything I missed or doing it wrong entirely?

2
+Pie Number of slices to send: Send
The problem is that you are sending your HTTP request  before adding your payload, resulting in a message exchange like this:

You should be calling getResponseCode() after setting your payload, which would result in a message exchange like this:

For example, using your code:



+Pie Number of slices to send: Send
Thank you very much Ron .... really appreciate it...
What I don't understand is how they changed the earth's orbit to fit the metric calendar. Tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 643 times.
Similar Threads
java.lang.IllegalStateException: Already connected
How to create REST CLIENT for HTTPS in Java?
json Post methiod in Java
Send POST method by HttpURLConnection to an unknown devices
Http 405: The specified HTTP method is not allowed for the requested resource (Request method 'POST'
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 07:14:46.