I don’t know why I can’t use the MultivaluedMap here, can someone help. Eclipse is giving me that it can’t be resolved into a type
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.util.Map;
import javax.net.ssl.SSLContext;
import com.sun.jersey.api.client.*;
import com.sun.jersey.api.client.config.ClientConfig;
import com.sun.jersey.api.client.config.DefaultClientConfig;
import com.sun.jersey.api.client.filter.Filterable;
import com.sun.jersey.core.util.MultivaluedMapImpl;
public class Main {
public static void main(String[] args) throws Exception {
Client client = Client.create();
WebResource webResource = client.resource("http://api.foursquare.com/v1/venues");
MultivaluedMap queryParams = new MultivaluedMapImpl();
queryParams.add("geolat", "51.543724");
queryParams.add("geolong", "-.102365");
String s = webResource.queryParams(queryParams).get(String.class);
}
}
What other stuff am I missing here
You need the jsr jar on your classpath. If you’re using Maven you can add:
or you can download the jar and add it manually:
http://download.java.net/maven/2/javax/ws/rs/jsr311-api/1.1.1/
Re: authentication, you should look at the FourSquare documentation:
http://groups.google.com/group/foursquare-api/web/api-documentation
http://groups.google.com/group/foursquare-api/web/oauth