0
我想從我的應用程序進行POST調用Facebook的圖形API。該方法的相關摘錄:如何進行Facebook營銷API的POST調用?
RestTemplate restTemplate = new RestTemplate();
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON);
headers.set("Authorization","Bearer "+ accessToken);
HttpEntity<EventSetVM> request = new HttpEntity<>(new EventSetVM(eventSetName), headers);
Map<String, String> params = new HashMap<>();
params.put("name", eventSetName);
String url = "https://graph.facebook.com/v2.8/" +
businessManagerId +
"/offline_conversion_data_sets";
EventSetVM eventSetVM = restTemplate.postForObject(url, request, EventSetVM.class, params);
從Firefox的RESTClient實現我得到的錯誤是
{
"timestamp": 1487779045470,
"status": 500,
"error": "Internal Server Error",
"exception": "org.springframework.web.client.HttpClientErrorException",
"message": "400 Bad Request",
"path": "<correct-path-with-no-parameters>"
}
這是怎麼回事?