William, you forgot one thing - to call either getResponseCode() or getInputStream(). The return value can be ignored, but without it the actual request won't be made.
Pat Farrell wrote:
abhishekj jain wrote:i dont want to use a form rather i want to use java api for this purpose. Can someone here paste some code to help.
It is possible, as folks have posted upthread. But I strongly recommend that you not do this. Instead, use the Apache HTTP client library. There are a huge number of subtle things that doing it by hand will skip.
Object oriented programming is about code-reuse. Use the Apache code.
I agree, but perhaps this is a school project which disallows the use of anything outside the core API. Just recently there was a
thread from someone who wasn't even allowed to use (Http)URLConnection, but had to do it all with Sockets manually.