我想要一个在线REST开放API(POST方法(,它只接受RequestBody作为String。我必须向那个开放的API发送一条消息。
restTemplate.postForEntity("myRequestUrl", "my message", String.class);
有几个网站提供公共API来测试请求,包括但不限于:
- https://httpbin.org/http://httpbin.org/
- https://webhook.site
- https://test-api.k6.io
- https://jsonplaceholder.typicode.com
- https://reqres.in
- https://fakestoreapi.com
您也可以在https://github.com/public-apis/public-apis.这些不一定是测试API,但它们返回真实的数据。也许它对某人有用。