ESP8266: HTTP GET results in 400 Bad Request

Hi,

I am trying to obrain data from pastebin.com/raw/1nmeKaux. I am using ESP8266 connected to arduino via SoftwareSerial with bound rate of 9600.

Every time I try to make a GET request I get 400 Bad Request.

This is what I am doing:

AT+CIPMUX=0


OK
AT+CIPMODE=0


OK
AT+CWJAP="wifi","wifi"

WIFI DISCONNECT
WIFI CONNECTED
WIFI GOT IP

OK
AT+CIPSTART="TCP","pastebin.com",80

CONNECT

OK
AT+CIPSEND=204


OK
> 

busy s...

Recv 204 bytes

SEND OK

+IPD,334:HTTP/1.1 400 Bad Request
Date: Fri, 23 Dec 2016 08:30:31 GMT
Content-Type: text/html
Content-Length: 177
Connection: close
Server: -nginx
CF-RAY: -

<html>
<head><title>400 Bad Request</title></head>
<body bgcolor="white">
<center><h1>400 Bad Request</h1></center>
<hr><center>cloudflare-nginx</center>
</body>
</html>
CLOSED
GET /raw/1nmeKaux HTTP/1.1\r\n
Host: pastebin.com\r\n
Connection: close\r\n
Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7\r\n
Cache-Control: no-cache\r\n
Accept-Language: de,en;q=0.7,en-us;q=0.3\r\n
\r\n

Filipsi:
Hi,

I am trying to obrain data from pastebin.com/raw/1nmeKaux. I am using ESP8266 connected to arduino via SoftwareSerial with bound rate of 9600.

AT+CIPSTART=“TCP”,“pastebin.com”,80

CONNECT

OK
AT+CIPSEND=204

OK

busy s…

Recv 204 bytes

SEND OK

+IPD,334:HTTP/1.1 400 Bad Request
Date: Fri, 23 Dec 2016 08:30:31 GMT
Content-Type: text/html
Content-Length: 177
Connection: close
Server: -nginx
CF-RAY: -

400 Bad Request

400 Bad Request


cloudflare-nginx CLOSED [/code]
GET /raw/1nmeKaux HTTP/1.1\r\n

Host: pastebin.com\r\n
Connection: close\r\n
Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7\r\n
Cache-Control: no-cache\r\n
Accept-Language: de,en;q=0.7,en-us;q=0.3\r\n
\r\n

A question, when you send the request packet to the esp8266, What was the exact C statements?

This is what I would expect:

Serial.print("GET /raw/1nmeKaux HTTP/1.1\r\n"); //28
Serial.print("Host: pastebin.com\r\n"); //20
Serial.print("Connection: close\r\n"); //19
Serial.print("Accept-Charset: ISO-8859-1,UTF-8;q=0.7,*;q=0.7\r\n"); //48
Serial.print("Cache-Control: no-cache\r\n"); //25
Serial.Print("Accept-Language: de,en;q=0.7,en-us;q=0.3\r\n"); //42
Serial.print("\r\n"); //2

I count 184 characters, not 204?

Chuck?