Discussion in "Embedded GSM Development" started by    amitcg    Jan 7, 2012.
Thu May 03 2012, 07:38 PM
#11
finally got this thing worked
but still i hv some queries
1.at+cdnscfg="0.0.0.0","0.0.0.0"
(i dont know wht to write over there that is i put "0.0.0.0" just played it blindly )
want to ask u is that fine..... anyhow they r generated automatically rite????
2nd thing is the response i m getting is that ok.....(i mean i m unable to figure out whts going on there)

thanks for d guidance amit sir.....

and ajay sir ur code dint actually work for me
GET /index.html HTTP/1.1 [cr][lf]
Host: www.example.com[cr][lf]
[cr][lf]

m nt getting any response by doing this............ y is tht so
(i had done wht amit sir said sending a blank line and cltr + z tht work for me)
n yes amit sir i actually need to put 2 blank lines
{
ie
cltr + j
cltr + j
cltr +z
}
after this only i got this response


[ Edited Thu May 03 2012, 07:43 PM ]
Thu May 03 2012, 08:30 PM
#12
1. You don't need to use at+cdnscfg command , it is for setting the Domain name server , but SIM300 automatically receives DNS when IP is configured , so don't use it ,unless u don;'t know DNS , and as i said u don't need to know , its automatic


2. "thing is the response i m getting is that ok " , Perhaps if you have opened "google.com" through SIM300 , u will get a stream of HTML DATA ,on ur hyperterminal , that's perfectly ok, this HTML code is the website code , that browser receives and shows u like a WEBSITE , u r seeing HTML code , that u can see on any web page using "view page source"
 sumitdby like this.
Thu May 03 2012, 08:45 PM
#13
hello amit sir.....
i tried skipping at+cdnscfg command n it works fine
bt some time i m getting
>>
+IPD1068:HTTP/1.0 400 Bad Request
Content-Type: text/html; charset=UTF-8
Content-Length: 925

whts wrong.....with this m putting same commands the one i got rite...........
Thu May 03 2012, 09:04 PM
#14
ctrl+z is required in case you choose my method or amit's method. What I gave you is the standard GET request header for HTML 1.1 there is no way you wont get anything..

If you want to test it.. just do a telnet on port 80 of any website and try my method.. you will see the answer. here is my attempt for downloading index.html from www.8051projects.net server

[email protected]:~$ telnet www.8051projects.net 80
GET /index.html HTTP/1.1
Host: www.8051projects.net


############
# Response from server
############
Trying 50.31.99.195...
Connected to 8051projects.net.
Escape character is '^]'.
HTTP/1.1 200 OK
Date: Thu, 03 May 2012 21:00:24 GMT
Server: Apache/2
X-Powered-By: PHP/5.2.17
Expires: Sat, 01 Jan 2000 00:00:00 GMT
Last-Modified: Thu, 03 May 2012 21:00:32 GMT
Cache-Control: must-revalidate
Set-Cookie: SESSCOOKIE=e51ba360a42163c985f0f99647e739f1; path=/; domain=.8051projects.net
Content-Language: en
ETag: "24685a492f8332053dbb4066ff853d8f"
Content-Length: 102590
Vary: Accept-Encoding,User-Agent
Content-Type: text/html; charset=utf-8

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang="en">
<head>
<meta http-equiv='content-type' content='text/html; charset=utf-8' />
### Rest of the HTML code...
Connection closed by foreign host.
Fri May 04 2012, 07:28 AM
#15
Hi.... ajay sir
m nt getting wht u r trying to say

what m doing is>>>>>
GET /index.html HTTP/1.1(ctrl+j ctrl+j ctrl+z)

thts it n m getting the above Response
but wen i try

GET /index.html HTTP/1.1(Enter shift+enter Enter shift+enter Enter shift+enter)
m not getting anything instead of a cursor shifted to the starting point of the line & blinking in the same line where i wrote >> GET /index.html HTTP/1.1

no response nthing i had to close the connection forcibly......

plzzzz tellme wht m i suppose do exactly so tht cn hv access to any website.....

1 more thing cn i do this>>>>> GET /index.php HTTP/1.1

thanks in advance


[ Edited Fri May 04 2012, 08:07 AM ]
Fri May 04 2012, 07:58 PM
#16
GET /index.html HTTP/1.1(ctrl+j ctrl+j ctrl+z) <--- this is not a standard way to access webpages. Not every server will reply you with this combination. You will get 400 response code (bad request) from those servers.

Well you have to do this way...
GET /index.html HTTP/1.1 (enter)(shift+enter)
after this you need to tell the server which host you want to access
Host: www.websitename.com (enter)(shift+enter)
(enter)(shift+enter)

this will send the complete request to server. some software sends LF (line feed) automatically. so you can also try with using only enter key without sending shift+enter. try again!!

To access website from telnet.. just go to command prompt and type:
> telnet www.websitename.com 80
Fri May 04 2012, 09:11 PM
#17

GET /index.html HTTP/1.1 (ctrl+m ctrl+j)
Host: www.websitename.com (ctrl+m ctrl+j)
accept:*/* (ctrl+m ctrl+j)
accept-language: en-us (ctrl+m ctrl+j)
ctrl+j
ctrl+j
ctrl+z

working fine for me i m able to access my website.....
thanks for your guidance....hope u will guide me if i face future doubt.....
this forum is really helpful....
c u soon
Sat May 05 2012, 08:19 PM
#18
congrats sumit good luck for future!
Tue May 15 2012, 04:17 AM
#19
Hi all,I am using sim300 modem for connecting to net, i found this forum very useful for me.I followed the steps mentioned in above posts and for Google's site, got response as

SEND OK+IPD988:HTTP/1.1 302 FoundLocation: http://www.google.co.in/Cache-Control: privateContent-Type: text/html; charset=UTF-8Set-Cookie: PREF=ID=59e4a5172caca3ec:FF=0:TM=1336987097:LM=1336987097:S=DRRVH_RmaiW6jpZi; expires=Wed, 14-May-2014 09:18:17 GMT; pamSet-Cookie: NID=59=fGtwwr6oQsrLpfAo8P77tXqI3XjWTb-tgB_BpgEQchTuINMrwn0wWwi9LNM1gmOsHpT9joFx0veZn3q_PfXCJmtbgcS11Q3lk1pMepLRErpXGFcfyP3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info."Date: Mon, 14 May 2012 09:18:17 GMTServer: gwsContent-Length: 221X-XSS-Protection: 1; mode=blockX-Frame-Options: SAMEORIGIN##SANITISED##><HEAD>##SANITISED## http-equiv="content-type" content="text/html;charset=utf-8"><TITLE>302 Moved</TITLE></HEAD>##SANITISED##><H1>302 Moved</H1>The document has moved<A HREF="http://www.google.co.in/">here</A>.##SANITISED##>##SANITISED##>

but when i try to connect to other sites im getting 'error 400 bad request'. pls tell me the reason for thisThanks,


[ Edited Tue May 15 2012, 04:18 AM ]
Tue May 15 2012, 07:42 PM
#20
as I already told using "ctrl+j ctrl+j ctrl+z" is not supported by all web servers. So please follow the steps I have mentioned.

GET /index.html HTTP/1.1 (enter)(shift+enter)
after this you need to tell the server which host you want to access
Host: www.websitename.com (enter)(shift+enter)
(enter)(shift+enter)

you can use simple enter too if that works for you. But as I know shift enter is required.

Get Social

Information

Powered by e107 Forum System

Conversation

Mon Mar 01 2021, 10:00 PM
Olivia Johnson
Citibank expects Bitcoin to hit USD$300,000 by end of this year.

Downloads

Comments

Mirza123
Thu Jun 25 2020, 03:46 PM
eunicelove124
Mon Jun 22 2020, 03:03 PM
cerouno
Tue Jun 16 2020, 05:10 PM
Marce
Sat Jun 13 2020, 09:43 PM
Davidthils
Thu May 21 2020, 12:44 PM
Jakeror
Thu May 21 2020, 01:28 AM
motorCar
Wed May 20 2020, 07:05 PM
Vordrync
Wed May 20 2020, 11:52 AM

Online

Guests: 96, Members: 0 ...

most ever online: 182184
(Members: , Guests: 182184) on 06 Aug 2010: 05:37 AM

Members: 38215
Newest member: Mirza123