Trying to post data to an ASP file

P

Prasanna

Hi All,
I am trying to post data to an ASP file with in IBM's WebSphere
environment. Can some one tell me why this code is not working. This
code does not give me any errors, but the data is being posted.

//mu URL
String strURL = "http://custcaredev.int.westgroup.co...qID=199&ReqEntryID=29483&FName=Attachment.csv";

System.out.println(" URL = " + strURL);//just printing to console

URL HoURL = new URL(strURL);
URLConnection urlc = HoURL.openConnection();
urlc.setDoInput (true);
urlc.setDoOutput(true);
urlc.setUseCaches (false);
urlc.setRequestProperty("Content-type","application/x-www-form-urlencoded");

DataOutputStream outSt = new DataOutputStream (urlc.getOutputStream
());
outSt.writeBytes(Fbody); //Fbody is a string. The data to be posted.
outSt.flush ();
outSt.close ();
System.out.println(" End - writing to the URL");

I tried this code from with in an EJB, and also using a servlet. The
ASP file did not get the posted data both the situations.

I appreciate any help in this regard.

Thanks
Prasanna
 
J

jhking

The first thing i'd do is make sure your data is formatted correctly.
There's a tool called curl (http://curl.haxx.se/) that will let send
gets and posts from a command line.
Dump your FBody to file and use that file as input to curl, make sure
everything works from there. If it doesn't fix that.
Are you by any chance trying to upload a file?
If you're uploading a file the content type should be
multipart/form-data IIRC.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top