Re: Using Httpwebrequest to Submit multipart/form-data
From: Gregory A Greenman (see_at_sig.below)
Date: 10/16/04
- Next message: Maileen: "SPlash screen and loading another form"
- Previous message: Larry Serflaten: "Re: Integer Do's And Don'ts"
- In reply to: Nick Malik: "Re: Using Httpwebrequest to Submit multipart/form-data"
- Next in thread: Joerg Jooss: "Re: Using Httpwebrequest to Submit multipart/form-data"
- Reply: Joerg Jooss: "Re: Using Httpwebrequest to Submit multipart/form-data"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 16 Oct 2004 20:36:52 GMT
In article <HAdcd.482227$8_6.62731@attbi_s04>,
nickmalik@hotmail.nospam.com says...
> That got right down to the details, didn't it?
>
> I take it that, even though this thread is not new, you have not solved the
> problem yet.
Nope, I had an important meeting out of town I had to prepare
for, plus I wanted to make my code more presentable before I
posted it.
> You look like you are doing things fairly well. You are collecting the
> cookies and passing them back, and the formatting looks pretty good. I
> would suggest, however, that the page that fails is calling a JSP, which
> means that the server side may have a good deal of logic to PREVENT folks
> like you from pretending to be a browser.
Here's the form tag for the three pages I'm trying to access. The
problem I was having was with the second form. It looks like the
third one uses Java, so that may be a problem there.
<FORM action="http://half.ebay.com/cat/sell/pmsearch.cgi"
method="post">
<form action="/cat/sell/save_new_listing.cgi"
enctype="multipart/form-data" method=post>
<form name="pricing" method="post" action="sell.jsp" onSubmit="if
(this.submitted) return false; else { this.submitted = true;
disableSubmits(this); return true; }">
> I don't see that you have set the User Agent header. It is probably normal
> for the JSP page to be attempting to identify the browser, perhaps to send
> back a message that will render correctly every time. I've done similar
> code (a little differently, but same concept) and I've had problems when I
> didn't set the User Agent header. That's where I would start.
That seems to have solved the problem, at least for this step. I
added this line:
HWRequest.UserAgent = "Mozilla/4.0 (compatible; MSIE 6.0; Windows
NT 5.1; SV1; .NET CLR 1.1.4322)"
and I was able to get past the problem. I did get a 404 error, so
I'm not all the way home yet, but I'm one step closer. Also, the
404 error came later than the 505 I was getting previously.
I'm about to head out the door, so I'll see if I can make any
more progress later tonight.
> If that doesn't work, there may be some software that you can install that
> will sniff your own port 80, showing you what packets are travelling. You
> can then access the pages using IE and then using your app, to see if there
> is another header, perhaps one added by some Javascript code that downloaded
> on the previous page, that you are not sending. I know that there is a tool
> for doing this that is downloadable open source using the Unix compatibility
> libraries (I used it about 18 months ago... don't remember the name but I'm
> sure I can find it, so if you can't, let me know and I will dig a little).
I found this: tcptrace http://www.tcptrace.com/. Hopefully I'll
be able to cross this next hurdle without it.
Thanks for the help,
Greg
- Next message: Maileen: "SPlash screen and loading another form"
- Previous message: Larry Serflaten: "Re: Integer Do's And Don'ts"
- In reply to: Nick Malik: "Re: Using Httpwebrequest to Submit multipart/form-data"
- Next in thread: Joerg Jooss: "Re: Using Httpwebrequest to Submit multipart/form-data"
- Reply: Joerg Jooss: "Re: Using Httpwebrequest to Submit multipart/form-data"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|