开发者

404 when calling post from resttemplate

I am attemtping to call a service using rest template and I am receiving a 404 error.

It's a POST. The signature of method is

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

I am attenpting to call this from the resttemplate with the following code.

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

Please advice what I am doing wrong. Thanks.


404 means the resource isn't found. If everything is fairly straightforward, it means there's an HTTP server running at localhost:8080, but no resource available at /sendScreenAsPostCard.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜