?
Solved

how to POST data using httpurlconnection?

Posted on 2009-07-14
5
Medium Priority
?
384 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

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…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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

752 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