Solved

Multiple posts to HttpURLConnection

Posted on 2002-04-27
6
278 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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 92

Accepted Solution

by:
objects earned 75 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
bunnyEars challenge 6 65
Fibonacci challenge 11 84
Unable to open debugger port in Intellij idea 6 88
strCount chalenge 3 51
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
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…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…

746 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

16 Experts available now in Live!

Get 1:1 Help Now