External HTML Post handling

Is there an easy way to handle a POST from a remote source that will accept the POSTed data and return additional data, but does not try to render any views?

My problem is that I have a remote machine (not running jQuery or javascript) that needs to send data to my web site via a POST command and then will receive other data on the reply from the POST command. I have this working as far as the data getting up to the database and the return data coming back, but when my reply comes back it keeps having the following attached to the end of the POST returned data that I was expecting:




<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><0A>

<html><head><0A>

<title>501 Method Not Implemented</title><0A>

</head><body><0A>

<h1>Method Not Implemented</h1><0A>

<p>0=Create to /index.html not supported.<br /><0A>

</p><0A>

<hr><0A>

<address>Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4 PHP/5.2.0-8+etch16 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_perl/2.0.2 Perl/v5.8

.8 Server at default Port 80</address><0A>

</body></html><0A>



If i understood your question, you need the following: when data comes back to you, provining from a post handler action, it must not have another data attached to it ?

if soo…then simply in your action returns data using :

$this->renderPartial("viewname with response");

it will disallow the layout for your desired output…

is this what you want ? sorry if not…

Hi bluyell.

No I do want to be able to return data from the POST so I can retrieve any pending messages that need to be transmitted back to the calling machine. I am receiving the data back, however, there is the additional 501 error coming back as well.

What I get back is shown below. The problem is that I don’t know why the part after the SHUT DOWN NOW message is appearing. I tried using a renderPartial assuming the error was due to some action trying to run, but I didn’t see it make a difference.




HTTP/1.1 200 OK<0D><0A>

Date: Wed, 09 May 2012 21:21:08 GMT<0D><0A>

Server: Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4 PHP/5.2.0-8+etch16 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_perl/2.0.2 Perl/v5.8.

8<0D><0A>

X-Powered-By: PHP/5.2.0-8+etch16<0D><0A>

Set-Cookie: PHPSESSID=c6fdb1f69e0818d2a98067c4f112522f; path=/<0D><0A>

Expires: Thu, 19 Nov 1981 08:52:00 GMT<0D><0A>

Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0<0D><0A>

Pragma: no-cache<0D><0A>

Content-Length: 27<0D><0A>

Content-Type: text/html; charset=UTF-8<0D><0A>

<0D><0A>

set message = SHUT DOWN NOW<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"><0A>

<html><head><0A>

<title>501 Method Not Implemented</title><0A>

</head><body><0A>

<h1>Method Not Implemented</h1><0A>

<p>0=Create to /index.html not supported.<br /><0A>

</p><0A>

<hr><0A>

<address>Apache/2.2.3 (Debian) mod_python/3.2.10 Python/2.4.4 PHP/5.2.0-8+etch16 mod_ssl/2.2.3 OpenSSL/0.9.8c mod_perl/2.0.2 Perl/v5.8

.8 Server at default Port 80</address><0A>

</body></html><0A>

<03><0D><0A>



I found the problem. I was sending an errant %03 instead of an ETX character to terminate the connection. Once that was fixed the problem went away.