[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: HTTPAPI How to do a POST
[1]http://json.org/
On Tue, Aug 27, 2013 at 8:05 PM, Henrik Rützou <[2]hr@xxxxxxxxxxxx>
wrote:
Hi Mike,
JSOn requires special character encoding - so it isn't just data that
you can post, besides
that JSON requires UTF-8 so any EBCDIC character that dosn't converts
into ASCII x'00'-
x'7F' needs endcoding.
�
On Tue, Aug 27, 2013 at 7:46 PM, Mike Krebs
<[3]mkrebs@xxxxxxxxxxxxxxxxxx> wrote:
The sending and receiving is straight forward. Look at any of the
post examples. JSON is just data that you can post.
But more importantly for your purposes, it says you are going to use
OAuth. That will have to be hand coded as I don't think anyone has
shared their code to do that. Adding the headers is not hard. But
you have to get the client identifier and secret, store it someplace
(maybe in your program?), and do the handshake to get the oauthToken
to put into the header yourself. I believe several people on the
list have successfully navigated the OAuth so you might be able to
get some help if you ask but as I said, no one shared code that I
could remember or find.
-----Original Message-----
From: [4]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
[mailto:[5]ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx] On Behalf Of Henrik
Rützou
Sent: Monday, August 26, 2013 5:34 PM
To: HTTPAPI and FTPAPI Projects
Subject: Re: HTTPAPI How to do a POST
Hi Kevin,
the HTTP header is a HTTPAPI thing, but you can mix powerEXT Core
procedures
(that supports json I/O) and HTTPAPI
Outgoing:
setContent('*none');
jsonNode('*object');
� jsonNode('*[6]string':'email':'somebody@xxxxxxxxxxxxx');
� jsonNode('*string':givenName':'Fred');
� jsonNode(*string':surname':Rubble');
jsonEndNode();
The Json object will be in bufAddr() and bufSize()
Ingoing (simple json string):
myMail = jsonToField(inAddr:inSize:'email');
myName = jsonToField(inAddr:inSize:'givenName');
mySurname = jsonToField(inAddr:inSize:'surname');
If there is any special data encodings the jsonNode() and jsonToField()
will
handle them.
On Mon, Aug 26, 2013 at 11:00 PM, Kevin Miller <[7]kmiller@xxxxxxxxx>
wrote:
> � �With the following settings:
>
>
> � �HTTP/1.1
> � �Accept: application/json
> � �Content-Type: application/json
> � �Authorization: OAuth oauth_token={oauthToken}
>
> � �{
> � � �"email": "[8]somebody@xxxxxxxxxxxxx",
> � � �"givenName": "Fred",
> � � �"surname": "Rubble"
> � �}
>
> � �I need to set it up to use json data both to and from the
external API,
> � �and pass in an email address, first and last name. I don't think
I need
> � �a parser, as the data is very limited that I'm passing in and
getting
> � �back. I also need to pass in an API Key as shown above in the
> � �Authorization line.
>
>
> � �Kevin
>
>
-----------------------------------------------------------------------
> This is the FTPAPI mailing list. �To unsubscribe, please go to:
> [9]http://www.scottklement.com/mailman/listinfo/ftpapi
>
-----------------------------------------------------------------------
>
>
--
Regards,
Henrik Rützou
�[10]http://powerEXT.com <[11]http://powerext.com/>
-----------------------------------------------------------------------
This is the FTPAPI mailing list. �To unsubscribe, please go to:
[12]http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------
--
Regards,
Henrik Rützou
� [13]http://powerEXT.com
�
--
Regards,
Henrik Rützou
� [14]http://powerEXT.com
�
References
1. http://json.org/
2. mailto:hr@xxxxxxxxxxxx
3. mailto:mkrebs@xxxxxxxxxxxxxxxxxx
4. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
5. mailto:ftpapi-bounces@xxxxxxxxxxxxxxxxxxxxxx
6. mailto:string%27%3A%27email%27%3A%27somebody@xxxxxxxxxxxxx
7. mailto:kmiller@xxxxxxxxx
8. mailto:somebody@xxxxxxxxxxxxx
9. http://www.scottklement.com/mailman/listinfo/ftpapi
10. http://powerEXT.com/
11. http://powerext.com/
12. http://www.scottklement.com/mailman/listinfo/ftpapi
13. http://powerext.com/
14. http://powerext.com/
-----------------------------------------------------------------------
This is the FTPAPI mailing list. To unsubscribe, please go to:
http://www.scottklement.com/mailman/listinfo/ftpapi
-----------------------------------------------------------------------