[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

how to POST data using httpurlconnection?

Posted on 2009-07-14
5
Medium Priority
?
386 Views
Last Modified: 2012-05-07
for example i want send a data:

String Sdata1 = "data1";
String Sdata2 = "data2";

how to send data1 and data2?

variables that use  at php code:
$data1
$data2

mybe if just using GET, i just set the URL to : http://www.a.com/test.php?data1=Sdata1&data2=Sdata2
,then connect();

but how if post?
0
Comment
Question by:iphone
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 1000 total points
ID: 24847838
0
 
LVL 92

Assisted Solution

by:objects
objects earned 1000 total points
ID: 24847858
the following shows you how to POST, basically include the query string in the 'body' instead of in the url

http://helpdesk.objects.com.au/java/how-do-i-send-a-post-request-using-java
0
 
LVL 92

Expert Comment

by:objects
ID: 24847862
and you don't need to use httpurlconnection
0
 

Author Closing Comment

by:iphone
ID: 31603190
thx to you both all work
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 24876658
:-)
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
This video teaches viewers about errors in exception handling.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question