[Help]Esp8266 modifies "GET" request before sending (Error 400 bad request)

Firmware used: 00170901
Baud rate: 115200

After sending the following line to the esp from arduino's serial using AT+CIPSEND:

GET / HTTP/1.0\r\nHost:www.onet.pl\r\n\r\n\r\n\r\n

I've intercepted the packet and that's what it actually looks like:

###[ Raw ]###
load = '\nGET / HTTP/1.0**r**nHost:www.onet.pl**r**n**r**n\r\n**'

It results in responses like this:

+IPD,323:HTTP/1.1 400 Bad Request
Server: nginx-accelerator
Date: Sat, 10 Dec 2016 01:59:46 GMT
Content-Type: text/html
Content-Length: 166
Connection: close

400 Bad Request

400 Bad Request


nginx

There are a lot of people struggling with the same error (400 bad request) and so far I haven't found a solution anywhere... Is there anyone who knows what could be the reason of such wickedness? Or someone who knows a solution?

so far I haven't found a solution anywhere.

Sure there is. Send a good request.

The server maintains logs of GET, POST, etc. requests. There may be more details there.

Usually, a GET request defines what script to run on the server. If you are trying to replicate the functionality of a browser, it is important to understand that a browser is NOT a dumb client. It will try asking for different scripts to be run, until it gets a response. You need to do the same. Or, more simply, ask for the right script in the first place.

Man, the problem is that what I send through the serial monitor to the arduino which passes it to the esp8266 module somewhere on its path becomes something different.
Single backslash "" becomes double backslash "\".
"GET" becomes "\nGET".

EDIT: I found out that the problem doesn't occur if I use AT+CIPSEND command from the code instead of using serial monitor

EDIT: I found out that the problem doesn't occur if I use AT+CIPSEND command from the code instead of using serial monitor

This suggests that you have the Serial Monitor app configured to add carriage return or line feed or both to everything sent, and you don't strip them off.

I tried with setting "no line ending" but the double slashes are still there

So, the code you didn't post still does something wrong. Bummer. I can't think of a single thing you could do.

But the script is blank, the communication occurs through the arduino IDE serial monitor which sends it to the esp (through arduino's pin 1 and 0). That's where I input the commands and for some reason it causes the bug. If I send the same commands from the code then it works properly.

Btw I tried it with the following firmware too:

AT version:0.51.0.0(Nov 27 2015 13:37:21)
SDK version:1.5.0
compile time:Nov 27 2015 13:57:56

But the result is the same