Quantcast
Channel: Android Mode - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 941

How can I modify a HTTP header for reading a JSONObject?

$
0
0

I need to modify the HTTP header like this: Please modify your client to use a HTTP header named "X-Auth-Token" with the underneath personal token as value.

Your API token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

this is my code:

String image = "";
String name = "";
String position = "";

void setup() {
  size(800, 860);
  textSize(20);
}

void draw() {
    getInfo();
      background(0);
      text(name,10,820);
      text(position,10,850);
    }
  }
}

void getInfo() {
try {
    JSONObject info = loadJSONObject("http:" + "//api.football-data.org/v1/teams/66/players");
    name = info.getString("name");
    position = info.getString("position");
  }
  catch (Exception e) {
    println("rats... " + e);
  }
}

Can someone please help me? (I'm new to processing)


Viewing all articles
Browse latest Browse all 941

Trending Articles