开发者

404 when calling post from resttemplate

开发者 https://www.devze.com 2023-03-27 12:31 出处:网络
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

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

精彩评论

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