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",
}}
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.
I get this error all the time when trying to make a class, even when I copy code from a program that is working fine. A few posts mention declaring within setup, but no luck so far. Thanks for any help
button1 = new MyButton(image1,image2,image3,100,100,100,100);
button2 = new MyButton(image1,image2,image3,200,200,200,200);
button3 = new MyButton(image1,image2,image3,400,400,300,300);
}
void draw(){
button1.update();
button2.update();
button3.update();
if (button1.getter_hovered()){
println("Button 1 is hovered over.");
}
if (button1.getter_clicked()){
println("Button 1 is clicked.");
}
}
//resize the images
imageBase.resize(sizeX, sizeY);
imageHover.resize(sizeX, sizeY);
imageClick.resize(sizeX, sizeY);
//assign the base image as the current image
imageCurrent = imageBase;
}
void update(){
//check where the mouse is
//is it over my button?
if (!mousePressed && mouseX>=locX && mouseX<=locX+sizeX && mouseY>=locY && mouseY<=locY+sizeY){
//set the hover image as the current image
imageCurrent = imageHover;
hovered = true;
clicked = false;
}
//is it clicking my button?
else if (mousePressed && mouseX>=locX && mouseX<=locX+sizeX && mouseY>=locY && mouseY<=locY+sizeY){
//set the clicked image to the current Image
imageCurrent = imageClick;
clicked = true;
hovered = false;
}
else{
imageCurrent = imageBase;
clicked = false;
hovered = false;
}
//update the onscreen image
image(imageCurrent,locX,locY);
}