Problem Description:

Sends the captcha service and returns when the service is invoked:

 <Map>   
    <data>     
        <status>0</status>     
        <message>success</message>     
        <data>         
            <id>420201223fcd2a1332b027026b0d7bde14d4cfae3791322381925744640</id>  
            <appSmsId>f574e13cc6d6427197ac520d59b84282</appSmsId>     
        </data>   
    </data>   
    <success>true</success> 
</Map>
Copy the code

However, json parsing is used, and XML is returned, so an error is reported

The solution

Add produces to the upstream interface:

 @RequestMapping(value="/send",produces = MediaType.APPLICATION_JSON_UTF8_VALUE) 
Copy the code

supplement

@requestMapping when does he use Consumes

Produces: Specifies the return value type. You can specify the return value type as well as the character encoding of the returned value.

Consumes: Specifies the content-types that handle requests, for example, application/ JSON or text/ HTML.