How to POST json to https
in
Programming Questions
•
2 years ago
Hi Everyone,
I'm trying to use the API for my online brokerage (OptionsHouse) and have gotten nowhere in the last 5 hours.
The API documentation says:
The OptionsHouse API is available through api.optionshouse.com. All requests must be sent
directly to api.optionshouse.com/j or api.optionshouse.com/m (specified below) via https
connections for security reasons. Requests should be POST requests with text/xml as content-
type...An API service has an expected JSON structure provided as input and will return a well-formed JSON structure as a result.
Here is their example json message for log-in:
{
"message":{
"action":"auth.login",
"data":{
"userName":"user1",
"password":"password",
}}
So far I've these forum threads and sites most helpful:
http://forum.processing.org/topic/http-post-processing
http://json.org/JSONRequest.html
http://data.oreilly.com/~aodewahn/processing_json/process_json.txt
http://blog.blprnt.com/blog/blprnt/processing-json-the-new-york-times (I wish the optionshouse api was this simple)
But I'm still very far from pulling things together. I am practicing using the Flickr API because I don't want to risk losing access to the optionshouse api due to mistakes in programming. If anyone knows a simple way of sending json format POST to https I'd greatly appreciate your help. Processing is really the only language I'm familiar with so all the Ajax jQuery and javascript stuff has me pounding my head against the wall.
Thanks,
Mike
I'm trying to use the API for my online brokerage (OptionsHouse) and have gotten nowhere in the last 5 hours.
The API documentation says:
The OptionsHouse API is available through api.optionshouse.com. All requests must be sent
directly to api.optionshouse.com/j or api.optionshouse.com/m (specified below) via https
connections for security reasons. Requests should be POST requests with text/xml as content-
type...An API service has an expected JSON structure provided as input and will return a well-formed JSON structure as a result.
Here is their example json message for log-in:
{
"message":{
"action":"auth.login",
"data":{
"userName":"user1",
"password":"password",
}}
So far I've these forum threads and sites most helpful:
http://forum.processing.org/topic/http-post-processing
http://json.org/JSONRequest.html
http://data.oreilly.com/~aodewahn/processing_json/process_json.txt
http://blog.blprnt.com/blog/blprnt/processing-json-the-new-york-times (I wish the optionshouse api was this simple)
But I'm still very far from pulling things together. I am practicing using the Flickr API because I don't want to risk losing access to the optionshouse api due to mistakes in programming. If anyone knows a simple way of sending json format POST to https I'd greatly appreciate your help. Processing is really the only language I'm familiar with so all the Ajax jQuery and javascript stuff has me pounding my head against the wall.
Thanks,
Mike
1