Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/jerdew5/orbworks.com/forum/includes/bbcode.php on line 472
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3368: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3370: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3371: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
[phpBB Debug] PHP Notice: in file /includes/functions.php on line 3372: Cannot modify header information - headers already sent by (output started at /includes/bbcode.php:472)
OrbWorks Community Forum • View topic - OrbForms NetSample

OrbForms NetSample

Discuss OrbForms Designer and PocketC Architect

Postby trajecto on Sat Jan 14, 2006 12:07 pm

I'm trying to read a simple text file off the web at: http://www.trajectorylabs.com/rss/text.txt - I am using the netSample app directly and am getting an "HTTP/1.1 404 Not Found" error. Any ideas?

Thanks,
Chris


handler buttonHeadlines.onselect() {
Network net;
Socket s;
string addr;
string rss;
int err;

err = net.open();
if (err != 0) {
fieldHeadlines.text = "Unable to open network, err = " + err;
return;
}

err = net.getHostByName("www.trajectorylabs.com", &addr);
if (err == 0) {
err = s.open(netAfInet, netSockStream, netProtoIpTcp);
if (err == 0) {
err = s.connect(addr + ":80"); // port 80
if (err == 0) {
err = s.sends("GET /rss/text.txt HTTP/1.0\r\n\r\n");
if (err == 0) {
err = s.recvs(&rss);
if (err == 0) {
fieldHeadlines.text = strleft(rss, 1024);
} else {
fieldHeadlines.text = "Unable to receive, err = " + err;
}
} else {
fieldHeadlines.text = "Unable to send, err = " + err;
}
} else {
fieldHeadlines.text = "Unable to connect, err = " + err;
}
s.close();
} else {
fieldHeadlines.text = "Unable to open socket, err = " + err;
}
} else {
fieldHeadlines.text = "Unable to resolve host, err = " + err;
}
scrollHeadlines.update(fieldHeadlines);
net.close();
}

handler scrollHeadlines.onmove() {
fieldHeadlines.scroll(event.value - event.prev);
update(fieldHeadlines);
}

handler fieldHeadlines.onhchange() {
scrollHeadlines.update(this);
}
trajecto
 
Posts: 51
Joined: Wed Aug 21, 2002 1:53 am
Location: USA

Postby dewey on Mon Jan 23, 2006 3:41 am

The reason for the 404 is that your host is probably on a shared server, where the IP address alone is not sufficient to determine which domain is being queried. Thus, you need to use HTTP/1.1 and include the Host header. I have tried this, however, and can't seem to get the server to respond at all with the 1.1 request. Hmm...
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Postby trajecto on Tue Jan 24, 2006 11:50 pm

What does the "\r\n\r\n" mean at the end of the HTTP GET request?
trajecto
 
Posts: 51
Joined: Wed Aug 21, 2002 1:53 am
Location: USA

Postby dewey on Wed Jan 25, 2006 4:07 am

That signifies the end of the HTTP header. http://www.w3.org/Protocols/rfc2616/rfc2616.html :)
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am

Postby trajecto on Thu Jan 26, 2006 1:10 am

Wait, I see, carriage return and line feed.
trajecto
 
Posts: 51
Joined: Wed Aug 21, 2002 1:53 am
Location: USA

Postby trajecto on Fri Jan 27, 2006 12:17 am

Jeremy,

How did you include the Host header when you tried that?
trajecto
 
Posts: 51
Joined: Wed Aug 21, 2002 1:53 am
Location: USA

Postby dewey on Tue Jan 31, 2006 4:53 am

err = s.sends("GET /index.html HTTP/1.1\r\nHost: http://www.orbworks.com\r\n\r\n");
dewey
Site Admin
 
Posts: 749
Joined: Sun Oct 21, 2007 5:12 am


Return to OrbForms Designer and PocketC Architect

Who is online

Users browsing this forum: No registered users and 2 guests

cron