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

Re: [Ftpapi] Curl vs LIBHTTP



Thanks Scott, the only problem I’m having is http_string doesn’t seem to be defined anywhere, perhaps I’m missing something?

 

 

Thank You,
John Place

284 Fuel Supply LLC
General Manager
Direct Line: 563-468-5289
Cell: 563-529-0162
Email: John.Place@xxxxxxxxxxxxxxx
            
Notice:  Any agreement discussed or implied in this message is for discussion purposes only and may not be relied upon to bind the company.  Agreements are binding only when fully committed to writing and executed by authorized representatives of all the parties.  The information contained herein, while provided in good faith and believed to be accurate, is provided by 284 Fuel Supply, LLC and or Iowa 80 Group, Inc. and their affiliates as an accommodation to their readers for information purposes only, it is not guaranteed as to accuracy or completeness.  The information contained in this communication is confidential and is intended only for the use of the addressee. It is solely the property of 284 Fuel Supply and or Iowa 80 Group Inc. and their affiliates. Unauthorized use of this information, in whole or in part, is strictly prohibited. If you have received this communication in error, please notify us immediately by return e-mail and destroy this communication, including all attachments and any copies.

 

From: ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx <ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx> On Behalf Of Scott Klement
Sent: Thursday, October 1, 2020 19:26
To: ftpapi@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: [Ftpapi] Curl vs LIBHTTP

 

Hi John,

The tool is named HTTPAPI (not 'LIBHTTP', though that would be the default name of the installation library).  You most likely don't need all of the headers you provided -- most of those are not typically used in REST APIs, but I will provide an example that specifies them, anyway, just in case.

For the most part, it will work in HTTPAPI exactly as you expect.  You POST to the URL, and pass the data and content-type as parameters.  to add the additional headers, you have to define an "xproc" (short for "exit procedure", basically its a callback routine) that will be called during the transaction.  That procedure can provide the headers as a parameter.

I've attached an example.

I don't have any way to try this out, so the code is untested -- but, hopefully it'll point you in the right direction.

-SK

 

On 10/1/2020 4:56 PM, John Place wrote:

I need to access an API and I’ve been using Curl but it isn’t friendly can I do this with your LIBHTTP?

 

I removed some information on purpose FYI

 

curl 'https://api.peachworks.com/v1/accounts//reports/77/run' \ 

      -H 'Connection: keep-alive' \ 

      -H 'Accept: application/json, text/plain, */*' \ 

      -H 'Authorization: ' \ 

      -H 'Content-Type: application/json' \ 

      -H 'Origin: https://my.getbeyond.com' \ 

      -H 'Referer: https://my.getbeyond.com/' \ 

      -H 'Accept-Language: en-US,en;q=0.9' \ 

      --data-binary $'{"params":["locations.id IN (3)","DAY = \'2020-09-28\'"],"report_type":"app","app_id":64}' \ 

      --compressed 

 

 



-- 
_______________________________________________
Ftpapi mailing list
Ftpapi@xxxxxxxxxxxxxxxxxxxxxx
http://scottklement.com/mailman/listinfo/ftpapi