I'm trying to instantiate an HttpGet Object so that I can send a get request to the foursquare api. However, every time I attempt this, (and I've tried it with several different tokens) I get the following error: java.lang.IllegalArgumentException: Illegal character in query at index 110: https://api.foursquare.com/v2/users/self/checkins?oauth_token=VIHXZZH1ZEXTXOYDFRHHWF42YREWKMNTABDTTVMMF3CSYTKW
It's in the format https://api.foursquare.com/v2/users/self/checkins?oauth_token=OAUTH_TOKEN. You can see my code below. Thanks in advance.
String checkinsUrl = "https://api.foursquare.com/v2/users/self/checkins";
String authUrl = checkinsUrl + "?oauth_token=" + this.token;
HttpGet getMethod = new HttpGet(authUrl);
This was actually just me being stupid. Foursquare sends back a code with is not the access token. You must then make an httpget with that code in order to get the access token.