2011-08-09 76 views
1

我試圖使用rest模板調用服務,並且收到404錯誤。404當從resttemplate調用post時

這是一個POST。方法的簽名是

String sendScreenAsPostcard(@RequestBody MultiValueMap<String, Object> params) 

我打算從resttemplate用下面的代碼調用它。

restTemplate.exchange(
      "http://localhost:8080/sendScreeenAsPostCard", 
      HttpMethod.POST, 
      new HttpEntity<MultiValueMap<String, Object>>(parameters, headers), 
      String.class 
     ).getBody() 

請指教我做錯了什麼。謝謝。

+0

sendScreeenAsPostCard vs sendScreeenAsPostcard – Karussell

回答

1

404表示找不到資源。如果一切都相當簡單,這意味着有一個在localhost:8080上運行的HTTP服務器,但在/ sendScreenAsPostCard上沒有資源可用。