Reputation: 759
I have a project where I use the GPRS Arduino Quadband module to connect to a specific website.
I can send AT commands and connect to the server and receive a response like this:
Serial.print("AT+KTCPCFG=0,0,\"http://www.google.com"); // Returns HTTP ok response
However I am wondering how would I connect to a specific webpage like www.domain_name.com/my_specific_page.php
. But when I try
Serial.print("AT+KTCPCFG=0,0,\"http://www.domain_name.com/my_specific_page.php");
I get a DNS error that the server cannot be found. What other header information do I include to be able to say the following?
Connect to domain x
Go to page Y on domain x
Upvotes: 0
Views: 710
Reputation: 759
I figured out the answer it was down to me not understanding http headers
When entering the information to connect to the domain you need to specify in the http request that the host is your domain name and the GET is the specific file on the server
It should be like this (CRLF means Carriage Return, Line Feed):
GET /my_specific_page.php HTTP/1.1[CRLF]
Host: www.domain_name.com[CRLF]
//Other header information
Upvotes: 0