Solved

how to POST data using httpurlconnection?

Posted on 2009-07-14
5
377 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
  • 2
  • 2
5 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 250 total points
Comment Utility
0
 
LVL 92

Assisted Solution

by:objects
objects earned 250 total points
Comment Utility
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
Comment Utility
and you don't need to use httpurlconnection
0
 

Author Closing Comment

by:iphone
Comment Utility
thx to you both all work
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
:-)
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

After being asked a question last year, I went into one of my moods where I did some research and code just for the fun and learning of it all.  Subsequently, from this journey, I put together this article on "Range Searching Using Visual Basic.NET …
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.

762 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now