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

Question Regarding Post Scenario

   Dear Fellow HTTPAPIer's:

   I have a scenario where I am attempting a post API as seen below.

              i@StatusCode =











   I know the authentication user and password will be bad (I'm doing
   some negative testing) and as expected the API fails. It returns "-1"
   as a value because the post fails. This surprised me a little as,
   based upon a prior set of emails, I thought the HTTP return code of
   401 would be returned here. But no matter, let's move on. So I know I
   have an issue and call Http_Error immediately as shown below.

            // get most recent HTTP result and associated text

            a@ErrorText = Http_Error(i@Error);

   Well this returns me values of 36, and "This page requires a user-id &
   password".  Now if I look at the debug log, I see that earlier in the
   process the expected 401 HTTP return code is intercepted as seen in
   the debug log excerpt below.

   Date: Sat, 02 Oct 2010 17:07:54 GMT

   Server: Apache-Coyote/1.1

   WWW-Authenticate: Basic realm="dashcs"

   Content-Type: text/html;charset=utf-8

   Content-Length: 1038

   Connection: close

   SetError() #13: HTTP/1.1 401 Unauthorized              

   recvdoc parms: identity 1038

   interpret_auth(): entered

   SetError() #36: This page requires a user-id & password

   http_close(): entered

   So my question is, how do I get that 401 return code programmatically?

   I might be mistaken but it seems that the Http_Url_Post_Raw returns
   the HTTP return code under certain circumstances but when it comes to
   this scenario it behaves differently.

   Any help would be appreciated.


This is the FTPAPI mailing list.  To unsubscribe, please go to: