You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by An...@gdc4s.com on 2011/04/07 01:04:31 UTC

[users@httpd] HTTP POST to a directory

I have an intranet website that provides web services.  Currently,
clients access this service by POSTing their XML SOAP request envelope
to a particular php script as follows (urls have been sanitized to
protect the guilty):

http://somesite:port/SERVICES/service.php

I receive the xml, process it, and return the result back to them, all
fine and dandy.
However, I would rather not have them specify a particular script file,
I simply want them to POST to:

http://somesite:port/SERVICES

Then, I want to be able to configure apache so that when it sees a POST
to this directory URL, it will run the script I specify and pass it the
POST data. 
Currently, if I attempt this, the client receives a 301 Moved
Permanently, and the redirected URL is the same as the one they posted
to (i.e., the directory URL above).

How do I configure apache to do this?


Thanks,
Tony 

Re: [users@httpd] HTTP POST to a directory

Posted by Yehuda Katz <ye...@ymkatz.net>.
On Wed, Apr 6, 2011 at 7:25 PM, Eric Covener <co...@gmail.com> wrote:

> On Wed, Apr 6, 2011 at 7:04 PM,  <An...@gdc4s.com> wrote:
> > However, I would rather not have them specify a particular script file, I
> > simply want them to POST to:
> >
> > http://somesite:port/SERVICES
>


If you suppress that, you can just set an Alias from /dir to
> /dir/whatever.xxx
>

You could set DirectoryIndex services.php

- Y

RE: [users@httpd] HTTP POST to a directory

Posted by An...@gdc4s.com.
If I suppress the trailing slash, then apache does a redirect, and redirects are handled before aliases, so the client gets a 301, and the particular client software I am dealing with won't follow redirects, he simply errs out.

-----Original Message-----
From: Eric Covener [mailto:covener@gmail.com] 
Sent: Wednesday, April 06, 2011 4:26 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] HTTP POST to a directory

On Wed, Apr 6, 2011 at 7:04 PM,  <An...@gdc4s.com> wrote:
> I have an intranet website that provides web services.  Currently, clients
> access this service by POSTing their XML SOAP request envelope to a
> particular php script as follows (urls have been sanitized to protect the
> guilty):
>
> http://somesite:port/SERVICES/service.php
>
> I receive the xml, process it, and return the result back to them, all fine
> and dandy.
>
> However, I would rather not have them specify a particular script file, I
> simply want them to POST to:
>
> http://somesite:port/SERVICES
>
> Then, I want to be able to configure apache so that when it sees a POST to
> this directory URL, it will run the script I specify and pass it the POST
> data.
>
> Currently, if I attempt this, the client receives a 301 Moved Permanently,
> and the redirected URL is the same as the one they posted to (i.e., the
> directory URL above).
>
Could be DirectorySlash in mod_dir.

If you suppress that, you can just set an Alias from /dir to /dir/whatever.xxx

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] HTTP POST to a directory

Posted by Eric Covener <co...@gmail.com>.
On Wed, Apr 6, 2011 at 7:04 PM,  <An...@gdc4s.com> wrote:
> I have an intranet website that provides web services.  Currently, clients
> access this service by POSTing their XML SOAP request envelope to a
> particular php script as follows (urls have been sanitized to protect the
> guilty):
>
> http://somesite:port/SERVICES/service.php
>
> I receive the xml, process it, and return the result back to them, all fine
> and dandy.
>
> However, I would rather not have them specify a particular script file, I
> simply want them to POST to:
>
> http://somesite:port/SERVICES
>
> Then, I want to be able to configure apache so that when it sees a POST to
> this directory URL, it will run the script I specify and pass it the POST
> data.
>
> Currently, if I attempt this, the client receives a 301 Moved Permanently,
> and the redirected URL is the same as the one they posted to (i.e., the
> directory URL above).
>
Could be DirectorySlash in mod_dir.

If you suppress that, you can just set an Alias from /dir to /dir/whatever.xxx

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org