?
Solved

Multiple posts to HttpURLConnection

Posted on 2002-04-27
6
Medium Priority
?
287 Views
Last Modified: 2008-03-06
I am able to post data and read the response on a HttpURLConnection, and I am able to do so repeatedly if I execute multiple URL.OpenConnection methods, create new input and output streams, etc.

Do I have to repeat all of these steps each time I want to do a POST/Read to the UL?

Thanks
0
Comment
Question by:garyz31
  • 3
  • 3
6 Comments
 
LVL 92

Expert Comment

by:objects
ID: 6974423
Depends on the HTTP server/servlet/cgi and proxys you are talking to.
0
 
LVL 1

Author Comment

by:garyz31
ID: 6974482
These are asp pages.
0
 
LVL 1

Author Comment

by:garyz31
ID: 6975552
I've also noticed that if I post data to a page, then I must read the response in order for the post to happen.  This seems to be the case even if the page doesn't have any response.  

Are my parameter settings causing this?
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 92

Accepted Solution

by:
objects earned 300 total points
ID: 6975670
I'd say you'd have to call openConnection each time then.
Have you just tried reading the response status? This should be enough to make the post happen.
0
 
LVL 1

Author Comment

by:garyz31
ID: 6979281
Reading the response code does cause the post to happen.

Thanks
0
 
LVL 92

Expert Comment

by:objects
ID: 6979296
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month15 days, 22 hours left to enroll

850 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