post to cgi, JSON in Headers?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

post to cgi, JSON in Headers?

Matthias Rebbe via use-livecode
Hi friends,

I am scripting a routine to upload a PDF file to a server.
So far, so good-> libURLMultipartFormData() is my friend.

but now the developer of the API send me two TOKENs for authentification and said:
"...and make sure you're posting the HTTP header data (the tokens) as application/json."
???
Now he is not available for the next hours. :-(

Anyone knows what he is talking about and how I can add this to my scripts?
Thanks a lot in advance!


Best

Klaus
--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: post to cgi, JSON in Headers?

Matthias Rebbe via use-livecode
As a file, or to a SQL database? I successfully store PDFs in a mySQL database as large blobs. For PDFs that are not large, a medium BLOB would probably be fine. I open the PDF for binary read, then read until EOF. But my PDFs are one or at most two page fillable forms.

Bob S


> On Jan 31, 2018, at 08:25 , Klaus major-k via use-livecode <[hidden email]> wrote:
>
> Hi friends,
>
> I am scripting a routine to upload a PDF file to a server.
> So far, so good-> libURLMultipartFormData() is my friend.
>
> but now the developer of the API send me two TOKENs for authentification and said:
> "...and make sure you're posting the HTTP header data (the tokens) as application/json."
> ???
> Now he is not available for the next hours. :-(
>
> Anyone knows what he is talking about and how I can add this to my scripts?
> Thanks a lot in advance!
>
>
> Best
>
> Klaus
> --
> Klaus Major


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: post to cgi, JSON in Headers?

Matthias Rebbe via use-livecode
Klaus I wonder if he wants you to let the server know what kind of data
you'll be sending up, it's not uncommon to set the headers this way when
posting data to an API:

putĀ "Content-Type: application/json" into tHeaders
set httpHeaders to tHeaders


Good luck!

Dave



Nicolas Cueto via use-livecode wrote
> As a file, or to a SQL database? I successfully store PDFs in a mySQL
> database as large blobs. For PDFs that are not large, a medium BLOB would
> probably be fine. I open the PDF for binary read, then read until EOF. But
> my PDFs are one or at most two page fillable forms.
>
> Bob S
>
>
>> On Jan 31, 2018, at 08:25 , Klaus major-k via use-livecode &lt;

> use-livecode@.runrev

> &gt; wrote:
>>
>> Hi friends,
>>
>> I am scripting a routine to upload a PDF file to a server.
>> So far, so good-> libURLMultipartFormData() is my friend.
>>
>> but now the developer of the API send me two TOKENs for authentification
>> and said:
>> "...and make sure you're posting the HTTP header data (the tokens) as
>> application/json."
>> ???
>> Now he is not available for the next hours. :-(
>>
>> Anyone knows what he is talking about and how I can add this to my
>> scripts?
>> Thanks a lot in advance!
>>
>>
>> Best
>>
>> Klaus
>> --
>> Klaus Major
>
>
> _______________________________________________
> use-livecode mailing list

> use-livecode@.runrev

> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





-----
"The first 90% of the task takes 90% of the time, and the last 10% takes the other 90% of the time."
Peter M. Brigham
--
Sent from: http://runtime-revolution.278305.n4.nabble.com/Revolution-User-f278306.html

_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode
Reply | Threaded
Open this post in threaded view
|

Re: post to cgi, JSON in Headers?

Matthias Rebbe via use-livecode
Hi Dave,

> Am 01.02.2018 um 16:28 schrieb Dave Kilroy via use-livecode <[hidden email]>:
>
> Klaus I wonder if he wants you to let the server know what kind of data
> you'll be sending up, it's not uncommon to set the headers this way when
> posting data to an API:
>
> put "Content-Type: application/json" into tHeaders
> set httpHeaders to tHeaders
>
> Good luck!

thank you, it is a tad more complicatd, but I'm in conversation with the developer already!

> Dave
>
>> ...
>>> Hi friends,
>>>
>>> I am scripting a routine to upload a PDF file to a server.
>>> So far, so good-> libURLMultipartFormData() is my friend.
>>>
>>> but now the developer of the API send me two TOKENs for authentification
>>> and said:
>>> "...and make sure you're posting the HTTP header data (the tokens) as
>>> application/json."
>>> ???
>>> Now he is not available for the next hours. :-(

Best

Klaus

--
Klaus Major
http://www.major-k.de
[hidden email]


_______________________________________________
use-livecode mailing list
[hidden email]
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode