[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: HTTPAPI post trouble



Sender: Sean Porterfield <sporter@xxxxxxxxxxxx>

Scott Klement wrote:

a) The Web page "test.php" posts to /test/return.php, whereas the
    sample RPG program you sent posts to /return.php.  Apparently
    there is no "/return.php" so you get a "404 Not Found" error.

Apparently, when I removed the URI variable I left the /test out and didn't actually run my test again. Oops! I did get a 404 with the code as posted. (I was really worried when I saw this response in two messages.... I thought I would have noticed that.)


b) In the HTML document, you have fields called remote, password and
    Submit. However, in the RPG program you have user, password and
    submit. I don't know if your PHP script is case-sensitive or not,
    but I wouldn't be so bold as to assume that 'submit' and 'Submit' are
    the same.  And, "remote" and "user" are definitely not the same :)

My return.php will dump any and all POST variables sent to it (view it as return.phps to see source). You are correct that my example as posted does not match what the bank expects, though.


c) A web browser will always assume that data keyed into an HTML form
    is content-type "application/x-www-form-urlencoded"  However, since
    HTTPAPI is more commonly used for Web services, it defaults to
    content-type "text/xml".  That means that the PHP script thinks
    that you're sending XML, and doesn't know how to interpret it!

Aha! This sounds familiar, so I may have seen you post something like this in the past. This allows me to post to my return.php and get the expected result.


Sadly, I still get the 400 error when posting to the bank site. I copied their form to my test.php and changed the ACTION to return.php. I see 4 fields output in my browser when I post it which matches the 4 fields I specified in the program. Running the RPG program produced /tmp/return.php which matched the source displayed in my browser.

They must be expecting something different in their program that accepts the post.

Their form is
https://elink-http4.bankofamerica.com/cehttp/html/logon.htm

I removed the CRLF I had added, but that made no difference when posting to the bank.

Maybe it will make more sense to me tomorrow :)

Thanks,
Sean
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubsribe from the list send mail
to majordomo@xxxxxxxxxxxxx with the body: unsubscribe ftpapi mymailaddr
-----------------------------------------------------------------------