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

RE: cURL - FTPAPI



The curl -F option means it's going to send that file to the server.  You don't want to include that file in the URI for HTTPAPI.  If it really contains information to send to the server, you need to send it.  Otherwise, do the GET without the "-F stream.file=c:/Temp/data/myfile.xml"
--
Sean Porterfield


-----Original Message-----
From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx [mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Michael Ryan
Sent: Wednesday, December 15, 2010 09:39
To: HTTPAPI and FTPAPI Projects
Subject: Re: cURL - FTPAPI

Well...I find this odd. I changed this to a GET, like this:

 rc = http_url_get('http://server.example.com:8090/solr/update +
                            -F stream.file=c:/Temp/data/myfile.xml' :
                            '/tmp/newfile.xml');

And I get the same 505 error. What is cURL doing that an HTTPAPI GET isn't doing? Doesn't cURL implement things like POSTs and GETs and file transfers and stuff like that? Nothing is returned in /tmp/newfile.xml; I'm getting the return code from the rc variable.

I'd rather not implement cURL on the iSeries if I don't have to.

Thanks...

On Wed, Dec 15, 2010 at 9:11 AM, Michael Ryan <michaelrtr@xxxxxxxxx> wrote:

> Hi Scott -
>
> Thanks for the reply. This is for a SOLR server, which is a search
> engine application that runs on a Windows box. The update process will
> update the search engine data base.
>
>  I don't want HTTPAPI to call cURL; I want to use HTTPAPI to do what
> cURL does. So I probably want to do a GET instead of a POST, right?
> I'll give that a go.
>
> Thanks!
>
> On Tue, Dec 14, 2010 at 2:05 PM, Scott Klement <sk@xxxxxxxxxxxxxxxx>wrote:
>
>> Hi Michael,
>>
>> Are you sure this is a valid URI?  It looks more like a Unix
>> command-line.  The HTTP protocol does not automatically let you run
>> remote commands on another server. (Though, a program could be
>> written that takes the URI, extracts the command from it, and runs
>> it.)
>>
>> Normally, cURL does the same thing that HTTPAPI does... so it seems
>> strange for HTTPAPI to ask cURL to do something?
>>
>> Can you provide more detail on how this web site is supposed to work,
>> and what it's supposed to do?
>>
>> You also said "there's not much in Data because I don't want to post
>> anything".  That's a strange thing to say.  Why are you using POST if
>> you don't have anything to POST?  Why not use GET?
>>
>>
>>
>> On 12/14/2010 8:26 AM, Michael Ryan wrote:
>> >
>> >     I want to do this cURL call:
>> >
>> >     curl [1]http://server.example.com:8090/solr/update -F
>> >     stream.file=c:/Temp/data/myfile.xml
>> >
>> >     using HTTPAPI. I've tried an http_url_post like this:
>> >
>> >     retlen = http_url_post(
>> >            '[2]http://server.example.com:8090/solr/update +
>> >              -F stream.file=c:/Temp/data/myfile.xml'
>> >                            : %Addr(Data)
>> >                            : %Len(%TrimR(Data))
>> >                            : '/tmp/newfile.xml');
>> >
>> >     and got back a 505 - not supported.
>> >
>> >     There's not much in Data cause I really don't want to post
>> > anything;
>> I
>> >     just want to run the update process with the file (myfile.xml)
>> >     specified.
>> >
>> >     Any ideas?
>> >
>> >     Thanks!

This email is confidential, intended only for the named recipient(s) above and may contain information that is privileged.  If you have received this message in error or are not the named recipient(s), please notify the sender immediately and delete this email message from your computer as any and all unauthorized distribution or use of this message is strictly prohibited.  Thank you.
-----------------------------------------------------------------------
This is the FTPAPI mailing list.  To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------