scrineym
scrineym

Reputation: 759

Arduino Uno GPRS shield connect to a specific webpage

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?

Upvotes: 0

Views: 710

Answers (1)

scrineym
scrineym

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

Related Questions