Tony Landis
msgbartop
Personal website of Tony Landis
msgbarbottom

02 Nov 07 Groovy Http POST/GET Class

I was working on a project in and needed to do POST as well as read the response headers.

I was unable to find a suitable class or method for this in either Groovy or Java, so I wrote this class. It opens a socket to the requested host, and writes to the socket using getOutputStream() and PrintWriter(). It reads the response from the server using DataInputStream() and getInputStream().

(more…)

Tags: , , ,