Response from ESP8266 is returning unknown characters I'm working on a project with Arduino UNO that needs connection with a cloud server, that is why I'm using ESP8266 module.

I'm already connecting to wi-fi and making GET and POST request but my problem is get the response from these requests.

Here is my code:

/* Doing all these steps to make the request
AT+RST
AT+CWMODE=1
AT+CWJAP="MyNetwork","MyPassword"
AT+CIPMUX=1
AT+CIPSTART=0,"TCP","myserver.com.br",80
AT+CIPSEND=0,270
*/

String data = "data=example";

String command = "POST /webservice/v1/dispositivo/atualizar_data_requisicao HTTP/1.1\r\n";
comando += "Host: " + SERVER + "\r\n";
comando += "User-Agent: Arduino/1.0\r\n";
comando += "Connection: Close\r\n";
comando += "Content-Type: application/x-www-form-urlencoded;\r\n";
comando += "Content-Length: " + String(data.length()) + "\r\n\r\n";
comando += data;

esp8266.println(command);

delay(2000);

String response;

while(esp8266.available()) {
  response += esp8266.readStringUntil('\r');
}

Serial.print("Request response: ");
Serial.println(response);


When I run this code the only response I can get is something like:

Recv 270 bxt⸮⸮C⸮
SEND OK

+IPD,0.569:HTTP/1.0 200 OK


But I was expecting a JSON.

Can someone tell me what I am doing wrong and how can I resolve it?



Edit.

Ok, after Code Gorilla helps me (Thank you so much) and a lot of research what I did was program Arduino UNO to send some commands that I invented to serial and program ESP8266 to read the serial and, depending of the command that it reads, do requests and stuff.

ESP8266 is a lot easyer to make requests and have a lot of others possibilities, like HTTPS requests, that you can't do using AT Commands.

When I create this ask I didn't know that I could program directly in ESP8266, but when Code Gorilla told me about it and helps me with some articles I could finally continue with my project.
String command = "POST /webservice/v1/dispositivo/atualizar_data_requisicao HTTP/1.1\r\n";
comando += "Host: " + SERVER + "\r\n";
...
esp8266.println(command);


I suspect this is just a typo because it shouldn't compile.  But you are adding all the HTTP headers to commando not command.

Usually the ? means that the character is unprintable.  So to help diagnose the issue display the integer value for each character that is returned.  Something LIKE this (I've never used a String before so length() might not be right)

Serial.print("Request response: ");
Serial.println(response);
for (int index = 0; index &lt; response.length(); ++index)
{
   Serial.print (response[index]);
   Serial.print (" ");
}


If you want to program the ESP directly then have a look at these guides, they should give you the general idea.  Its usually as easy as programming an UNO once you are setup.

http://www.whatimade.today/esp8266-easiest-way-to-program-so-far/
https://learn.adafruit.com/adafruit-huzzah-esp8266-breakout/using-arduino-ide
https://www.hackster.io/harshmangukiya/how-to-program-esp8266-with-arduino-uno-efb05f