sparrowzoo / sparrow-shell

sparrow-shell
83 stars 36 forks source link

JSON response should have `content-type` = `application/json` #20

Closed skyline75489 closed 2 years ago

skyline75489 commented 2 years ago

https://github.com/sparrowzoo/sparrow-shell/blob/aeafb5afe77b4c5316915ce61b8bf1e40aeff4de/sparrow-test/src/main/java/com.sparrow/controller/HelloController.java#L69

This now returns text/html which is not expected.

sparrowzoo commented 2 years ago

image auto support content-type = application/json

https://github.com/sparrowzoo/sparrow-shell/blob/master/sparrow-mvc/src/main/java/com/sparrow/mvc/result/impl/JsonMethodReturnValueResolverHandlerImpl.java

skyline75489 commented 2 years ago

Interesting. I see different result:

http://www.sparrowzoo.com/json-test.json

image

skyline75489 commented 2 years ago

Full payload:

image

sparrowzoo commented 2 years ago

done