Currently im working on a project which need SMS retrieve functionality added to the system. I have use spingboot to build the application.All the implementation done and i have followed the all necessary configurations on twillio to retrieve sms from client. When i send a sms to Twilio api, it state the `Unsupported Media Type` in the debugger. I am sending also the required content type to api. **This happens when im sending an sms to number which is provided by twilio. But postman calls to the application working fine**.

```
package com.crustykrabs.application.service;

import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import static spark.Spark.*;
import com.twilio.twiml.MessagingResponse;
import com.twilio.twiml.messaging.Body;
import com.twilio.twiml.messaging.Message;

@RestController
public class TextMessageController {

    @PostMapping(path = "/messages/textmessages/receive", consumes = "application/xml", produces = "application/xml")
    public @ResponseBody ResponseEntity<String> receive() {
            Body body = new Body
                    .Builder("The Robots are coming! Head for the hills!")
                    .build();
            Message sms = new Message
                    .Builder()
                    .body(body)
                    .build();
            MessagingResponse twiml = new MessagingResponse
                    .Builder()
                    .message(sms)
                    .build();
            return ResponseEntity.ok().contentType(MediaType.APPLICATION_XML).body(twiml.toXml());
    }
}

```

[![enter image description here](https://i.stack.imgur.com/Pjzt4.png)](https://i.stack.imgur.com/Pjzt4.png)