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
Page 1 of 1

PostPosted: Sat Jan 14, 2006 12:07 pm
by trajecto
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);
}

PostPosted: Mon Jan 23, 2006 3:41 am
by dewey
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...

PostPosted: Tue Jan 24, 2006 11:50 pm
by trajecto
What does the "\r\n\r\n" mean at the end of the HTTP GET request?

PostPosted: Wed Jan 25, 2006 4:07 am
by dewey
That signifies the end of the HTTP header. http://www.w3.org/Protocols/rfc2616/rfc2616.html :)

PostPosted: Thu Jan 26, 2006 1:10 am
by trajecto
Wait, I see, carriage return and line feed.

PostPosted: Fri Jan 27, 2006 12:17 am
by trajecto
Jeremy,

How did you include the Host header when you tried that?

PostPosted: Tue Jan 31, 2006 4:53 am
by dewey
err = s.sends("GET /index.html HTTP/1.1\r\nHost: http://www.orbworks.com\r\n\r\n");