2017-02-08 14 views
0

Eventful APIを使用して近くのイベントのリストを取得しようとしていますが、リクエストで結果を取得できませんでした。 誰でも問題が何であるか知っていますか?Eventful API [JSON]の結果が得られません

JSONリクエストです。String url_request = "http://eventful.com/json/events?q=music&l=Singapore&api_key=" + API_KEY;

これは私の現在の出力である:

{ "sponsored_search_data":NULL、 "場所":{ "geo_ip_fail": "0"、 "LOCATION_TYPE":NULL、 "location_idの" NULL "geo_ip_guess": null、 "meta_name": "Worldwide"、 "pretty_name": "Worldwide"}、 "localized_base_url": "http://eventful.com"、 "is_default_eventful_site": "1"、 "facebook_app_namespace": "eventful"、 "home_url": "/"

列url_request =}

package EventTest.EventTest; 

import java.io.IOException; 
import com.squareup.okhttp.OkHttpClient; 
import com.squareup.okhttp.Request; 
import com.squareup.okhttp.Response; 


public class App 
    { 
     private static final String API_KEY = "my_api_key"; 
     OkHttpClient client = new OkHttpClient(); 

     public static void main(String[] args) throws IOException 
    { 
    App request = new App(); 

    String url_request = "http://eventful.com/json/events?q=music&l=Singapore&api_key=" + API_KEY; 
     String response = request.run(url_request); 

    System.out.println(response); 

} 

public String run(String url) throws IOException { 
    Request request = new Request.Builder().url(url).build(); 

    Response response = client.newCall(request).execute(); 
    return response.body().string(); 
    } 
} 

答えて

関連する問題