Skip to main content
deleted 50 characters in body; edited tags; edited title
Source Link
Mahozad
  • 26.4k
  • 19
  • 163
  • 200

Sending HTTP POST Request In Java....

lets assumeGiven this URL...:

http://www.example.com/page.php?id=10 

(Here id needs to be sent in a POST request)

I want to send the id = 10 to the server's page.php, which accepts it in a POST method.

How can iI do this from withinwith Java?

I tried this :

URL aaa = new URL("http://www.example.com/page.php"); URLConnection ccc = aaa.openConnection(); 
URL aaa = new URL("http://www.example.com/page.php"); URLConnection ccc = aaa.openConnection(); 

But I still can't figure out how to send it viawith POST method.

Sending HTTP POST Request In Java....

lets assume this URL...

http://www.example.com/page.php?id=10 

(Here id needs to be sent in a POST request)

I want to send the id = 10 to the server's page.php, which accepts it in a POST method.

How can i do this from within Java?

I tried this :

URL aaa = new URL("http://www.example.com/page.php"); URLConnection ccc = aaa.openConnection(); 

But I still can't figure out how to send it via POST

Sending HTTP POST Request In Java

Given this URL:

http://www.example.com/page.php?id=10 

I want to send the id = 10 to the server's page.php, which accepts it in a POST method.

How can I do this with Java?

I tried this :

URL aaa = new URL("http://www.example.com/page.php"); URLConnection ccc = aaa.openConnection(); 

But I still can't figure out how to send it with POST method.

Question Protected by CommunityBot

lets assume this URL...

http://www.example.com/page.php?id=10 

(Here id is no GET itsneeds to be sent in a POST Request...request)

now here i wannaI want to send the the id = 10...toid = 10 to the server's page page.php becausepage.php, which accepts it isin a POST method i m not able to send this like /page.php?id=10...

howHow can i do this in java....from within Java?

i didI tried this :

URL aaa = new URL("http://www.example.com/page.php"); URLConnection ccc = aaa.openConnection(); 

now whats next...just show meBut I still can't figure out how to send id = 10 on page.php using Java...aait via POST

lets assume this URL...

http://www.example.com/page.php?id=10 

(Here id is no GET its POST Request...)

now here i wanna send the the id = 10...to the server's page page.php because it is POST method i m not able to send this like /page.php?id=10...

how can i do this in java....

i did this :

URL aaa = new URL("http://www.example.com/page.php"); URLConnection ccc = aaa.openConnection(); 

now whats next...just show me how to send id = 10 on page.php using Java...aa

lets assume this URL...

http://www.example.com/page.php?id=10 

(Here id needs to be sent in a POST request)

I want to send the id = 10 to the server's page.php, which accepts it in a POST method.

How can i do this from within Java?

I tried this :

URL aaa = new URL("http://www.example.com/page.php"); URLConnection ccc = aaa.openConnection(); 

But I still can't figure out how to send it via POST

Source Link
Jazz
  • 3.8k
  • 4
  • 19
  • 6

Sending HTTP POST Request In Java....

lets assume this URL...

http://www.example.com/page.php?id=10 

(Here id is no GET its POST Request...)

now here i wanna send the the id = 10...to the server's page page.php because it is POST method i m not able to send this like /page.php?id=10...

how can i do this in java....

i did this :

URL aaa = new URL("http://www.example.com/page.php"); URLConnection ccc = aaa.openConnection(); 

now whats next...just show me how to send id = 10 on page.php using Java...aa