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

RE: HTTPAPI Timeout issue



I'm thinking that the issue here may be that the first call
http_setauth does in deed complete successfully, and stripe is returning a
valid response, but on the second call its expecting another set of
credentials which it doesn't receive and therefore fails.

One thing they mention in their documentation, each api request must be
authenticated, but I'm not sure who to pass additional parms with the
authentication call, if that is even possible.



> I was able to finally get back to this.  Two things:
>
> 1. rc is still returning a -1
> 2. http_debug never writes to the temp file.
>
> So I'm not sure where to go from here.
>
> Dutch
>
>
>> Here is short HTTPAPI driven test (no error checking but you will add
>> that):
>>
>> H DFTACTGRP(*NO) ACTGRP(*NEW) BNDDIR('HTTPAPI')
>> D/copy qrpglesrc,httpapi_h
>> D cmd             pr                  extpgm('QCMDEXC')
>> D  command                     200A   const
>> D  length                       15P 5 const
>> D rc              S             10I 0
>> D err             S             10I 0
>> D userid          S             50A
>> D pass            S             50A
>> D URL             s            256A
>>
>>   *inlr  = *on ;
>>   http_debug(*on);
>>
>>   userid = 'sk_test_BQokikJOvBiI2HlWgH4olfQ2';
>>   pass   = '';
>>   URL = 'https://api.stripe.com/v1/charges';
>>
>>   rc = http_setauth(HTTP_AUTH_BASIC : userid : pass);
>>   rc = http_url_get(URL : '/tmp/rpglist.html');
>>
>>   cmd('DSPF ''/tmp/rpglist.html''': 200);
>>
>>
>>
>>
>> -----Original Message-----
>> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Mike Krebs
>> Sent: Tuesday, February 24, 2015 1:58 PM
>> To: HTTPAPI and FTPAPI Projects
>> Subject: RE: HTTPAPI Timeout issue
>>
>> On the stripe.com site, it indicates that basic authentication is used.
>> And that fits with the example curl you provided.
>>
>>
>>
>> -----Original Message-----
>> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
>> [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of RPG List
>> Sent: Tuesday, February 24, 2015 7:42 AM
>> To: HTTPAPI and FTPAPI Projects
>> Subject: Re: HTTPAPI Timeout issue
>>
>> One additional point, I still believe that they are expecting the user
>> name to be passed as a parm, now how that should be constructed, I'm
>> trying to find out....
>>
>> I don't believe they are using http authentication itself...
>>
>> Dutch
>>
>>
>>> I will when I get a free moment to jump back on that project, but it
>>> will be tonight at the latest.
>>>
>>> Thanks for the reply,
>>>
>>> Dutch
>>>
>>>
>>>>    Hi Dutch,
>>>>    can you please put a http_debug in here?
>>>>    Thx,
>>>>    RaduÂ
>>>>
>>>>    On Mon, Feb 23, 2015 at 11:19 AM, RPG List <[1]rpglist@xxxxxxxxxxx>
>>>>    wrote:
>>>>
>>>>      Scott,
>>>>      I tried that, but I'm still getting a timeout.  I believe that
>>>> they
>>>>      are
>>>>      expecting the username to be passed as a parameter not as
>>>> basic_auth
>>>>      > Dutch,
>>>>      >
>>>>      > User/Password in HTTPAPI are set by calling the http_setAuth()
>>>>      > routine.   Assuming you want Basic authentication (which is
>>>> the
>>>>      default
>>>>      > in web browsers) you'd do it like this:
>>>>      >
>>>>      >       c                   callp    Â
>>>> http_setAuth(
>>>>      HTTP_AUTH_BASIC
>>>>      >       c                             :
>>>>      'sk_test_BQokikJOvBiI2HlWgH4olfQ2'
>>>>      >       c                             : '' );
>>>>      >Â  Â  Â  Â c
>>>>      >       c                   eval      rc =
>>>>      http_url_post(
>>>>      >Â  Â  Â  Â c '[2]https://api.stripe.com/v1/charges'
>>>>      >       c                             :
>>>> myPointer
>>>>      >       c                             :
>>>> dataSize
>>>>      >       c                             :
>>>>      '/tmp/testpost.html'
>>>>      >       c                             :
>>>>      HTTP_TIMEOUT
>>>>      >       c                             :
>>>>      HTTP_USERAGENT
>>>>      >       c                             :
>>>>      'application/x-www-form-urlencoded'
>>>>      > )
>>>>      >
>>>>      >
>>>>      > On 2/22/2015 7:04 AM, RPG List wrote:
>>>>      >> Scott,
>>>>      >> I am attempting to send a login credential, no password, just
>>>> the
>>>>      login.
>>>>      >>
>>>>      >> It must be sent via https and with
>>>>      application/x-www-form-urlencoded, I
>>>>      >> thought I could use the curl example but I see that was wrong.
>>>>      >>
>>>>      >>
>>>>      >>
>>>>      >>
>>>>      --------------------------------------------------------------------
>>>>      ---
>>>>      >> This is the FTPAPI mailing list.  To unsubscribe, please go
>>>> to:
>>>>      >> [3]http://www.scottklement.com/mailman/listinfo/ftpapi
>>>>      >>
>>>>      --------------------------------------------------------------------
>>>>      ---
>>>>      >>
>>>>      >
>>>>      >
>>>>      --------------------------------------------------------------------
>>>>      ---
>>>>      > This is the FTPAPI mailing list.  To unsubscribe, please go
>>>> to:
>>>>      > [4]http://www.scottklement.com/mailman/listinfo/ftpapi
>>>>      >
>>>>      --------------------------------------------------------------------
>>>>      ---
>>>>      >
>>>>      --------------------------------------------------------------------
>>>>      ---
>>>>      This is the FTPAPI mailing list.  To unsubscribe, please go to:
>>>>      [5]http://www.scottklement.com/mailman/listinfo/ftpapi
>>>>      --------------------------------------------------------------------
>>>>      ---
>>>>
>>>>    --
>>>>    R.
>>>>
>>>> References
>>>>
>>>>    1. mailto:rpglist@xxxxxxxxxxx
>>>>    2. https://api.stripe.com/v1/charges
>>>>    3. http://www.scottklement.com/mailman/listinfo/ftpapi
>>>>    4. http://www.scottklement.com/mailman/listinfo/ftpapi
>>>>    5. http://www.scottklement.com/mailman/listinfo/ftpapi
>>>> ---------------------------------------------------------------------
>>>> -- This is the FTPAPI mailing list.  To unsubscribe, please go to:
>>>> http://www.scottklement.com/mailman/listinfo/ftpapi
>>>> ---------------------------------------------------------------------
>>>> --
>>>>
>>>
>>>
>>> ----------------------------------------------------------------------
>>> - This is the FTPAPI mailing list.  To unsubscribe, please go to:
>>> http://www.scottklement.com/mailman/listinfo/ftpapi
>>> ----------------------------------------------------------------------
>>> -
>>>
>>>
>>
>>
>> -----------------------------------------------------------------------
>> This is the FTPAPI mailing list.  To unsubscribe, please go to:
>> http://www.scottklement.com/mailman/listinfo/ftpapi
>> -----------------------------------------------------------------------
>> -----------------------------------------------------------------------
>> This is the FTPAPI mailing list.  To unsubscribe, please go to:
>> http://www.scottklement.com/mailman/listinfo/ftpapi
>> -----------------------------------------------------------------------
>> -----------------------------------------------------------------------
>> This is the FTPAPI mailing list.  To unsubscribe, please go to:
>> http://www.scottklement.com/mailman/listinfo/ftpapi
>> -----------------------------------------------------------------------
>>
>>
>
>
> -----------------------------------------------------------------------
> This is the FTPAPI mailing list.  To unsubscribe, please go to:
> http://www.scottklement.com/mailman/listinfo/ftpapi
> -----------------------------------------------------------------------
>
>


-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------