简体   繁体   中英

using spring boot like postman

I want to test my rest service, but without postman or jmeter. Is it possible get json response via spring boot?

Example:

@Annotation
JSON request(JSON url){
...
}
or
@Annotation
String request(String url){
...
}

You could use curl from the commandline to test your restservice. Please see https://www.keycdn.com/support/popular-curl-examples for examples on how to do this.

In addition you might also want to write unittests using MockMvc. Please see https://spring.io/guides/gs/testing-web/ for more information about testing the web layer.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM