[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HTTP PUT (without Body)
Thanks Scott and Mike.
That was the key. With fine tuning I am able to do PUT now without errors...
Thx,
AA.
> On Dec 9, 2015, at 2:32 PM, Scott Klement <sk@xxxxxxxxxxxxxxxx> wrote:
>
>
> Actually, the error is about the 'save proc' pointer (not one of the data pointers). I would try making sure you provide a value for the peSaveProc,. For example, define a procedure (even if it does nothing with the data). Off the top of my head (I didn't test it) it would look something like this:
>
> P mySaveProc B
> D PI 10i 0
> D fd 10i 0 value
> D data * value
> D length 10i 0 value
> C return length
> P E
>
> Then when calling http_persist_req(), pass %paddr(mySaveProc) for the peSaveProc parameter.
>
> That should eliminate the error you're getting right now (I don't know without trying it if there will be other errors.)
>
> -SK
>
>
>
>
>> On 12/9/2015 12:21 PM, Mike Krebs wrote:
>> Without digging into http_persist_req it sounds like it is expecting some data where you passed *null. Try using a data location with length zero. Or because the server sounds like it will throw away any data, send it a space.
>>
>>
>> -----Original Message-----
>> From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Nilemind
>> Sent: Wednesday, December 9, 2015 11:55 AM
>> To: HTTPAPI and FTPAPI Projects
>> Subject: HTTP PUT (without Body)
>>
>> Hi,
>>
>> I have upgraded the version of LIBHTTP to use PUT protocol. However the requirement is to call PUT API without any body or data. In otherwords I am just calling the url without any content using PUT. As per Http_persist_req it looks for data pointer and length where I am passing null and 0.
>> Similarly they dont return any json back from this put and hence passing null in that response too. However Making all these above it is not working as expected. Either I get length needed as error message or '-1' as result of http_persist_req. Could you please guide me here. Thanks in advance.
>>
>> rc = http_persist_req( 'PUT'
>> : Pointer
>> : urlS
>> : 0
>> : *Null
>> : *Null
>> : 0
>> : 0
>> : *Null
>> : 300
>> : *omit
>> : 'application/json');
>>
>>
>> Error is thrown at HTTPAPIR4
>>
>> eval rc = saveproc( peFD
>> : %addr(wwData)
>> : wwLen )
>>
>> with msg - Pointer not set for location referenced.
>> -----------------------------------------------------------------------
>> 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
-----------------------------------------------------------------------