HTTP Request seems to always be GET

29 views
Skip to first unread message

Jason Graves

unread,
Jan 27, 2017, 9:26:07 AM1/27/17
to Lucee

I'm building a new API server using Lucee, and I just noticed that all of my requests are coming in as GET.  I'm using Postman for testing, and when I do a POST the result via both CGI.request_method and getHttpRequestData().method are both displaying GET.

I'm running Apache2 on Ubuntu.

Anyone else run into this?

Jason

Dominic Watson

unread,
Jan 27, 2017, 9:41:53 AM1/27/17
to lu...@googlegroups.com
One cause that springs to mind that would produce this behaviour is some kind of redirect (rather than rewrite) rules going on. If there are URL redirects going on somewhere in the stack, the redirected URL will always be a GET. e.g. if you had a redirect rule in apache to change URLs not ending in a slash to ending in a slash, you'd get this:

POST /some/url -> Apache response: redirect to /some/url/
GET /some/url/ -> Lucee receives this when expecting POST

Check the network tab in your browser, you'll be able to see this behaviour if that is the case.

(I've not seen this behaviour in any other scenario personally).


--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/9398a45f-0550-42ea-a4a0-4c8f32a24222%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Dominic Watson
Technical Lead

Pixl8 Interactive, 3 Tun Yard, 
Peardon Street, London, SW8 3HT

        

Jason Graves

unread,
Jan 27, 2017, 9:47:04 AM1/27/17
to lu...@googlegroups.com
That makes sense, and I am doing a redirect in apache pointing everything to index.cfm.

So should I be doing a rewrite?  Or is there a way to capture the original method?

Jason

On Fri, Jan 27, 2017 at 9:41 AM Dominic Watson <dominic...@pixl8.co.uk> wrote:
One cause that springs to mind that would produce this behaviour is some kind of redirect (rather than rewrite) rules going on. If there are URL redirects going on somewhere in the stack, the redirected URL will always be a GET. e.g. if you had a redirect rule in apache to change URLs not ending in a slash to ending in a slash, you'd get this:

POST /some/url -> Apache response: redirect to /some/url/
GET /some/url/ -> Lucee receives this when expecting POST

Check the network tab in your browser, you'll be able to see this behaviour if that is the case.

(I've not seen this behaviour in any other scenario personally).

On 27 January 2017 at 14:26, Jason Graves <jasono...@gmail.com> wrote:

I'm building a new API server using Lucee, and I just noticed that all of my requests are coming in as GET.  I'm using Postman for testing, and when I do a POST the result via both CGI.request_method and getHttpRequestData().method are both displaying GET.

I'm running Apache2 on Ubuntu.

Anyone else run into this?

Jason








--


You received this message because you are subscribed to the Google Groups "Lucee" group.


To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.



To post to this group, send email to lu...@googlegroups.com.


To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/9398a45f-0550-42ea-a4a0-4c8f32a24222%40googlegroups.com.


For more options, visit https://groups.google.com/d/optout.





--

Dominic Watson
Technical Lead

Pixl8 Interactive, 3 Tun Yard, 
Peardon Street, London, SW8 3HT

        










--


You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.


To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/YBhKW_IL9nk/unsubscribe.


To unsubscribe from this group and all its topics, send an email to lucee+un...@googlegroups.com.



To post to this group, send email to lu...@googlegroups.com.


Dominic Watson

unread,
Jan 27, 2017, 9:53:01 AM1/27/17
to lu...@googlegroups.com
You should almost certainly be doing a rewrite in this scenario, yes.

You will always lose form POST params with redirects :)






On 27 January 2017 at 14:46, Jason Graves <jasono...@gmail.com> wrote:
That makes sense, and I am doing a redirect in apache pointing everything to index.cfm.

So should I be doing a rewrite?  Or is there a way to capture the original method?

Jason
On Fri, Jan 27, 2017 at 9:41 AM Dominic Watson <dominic...@pixl8.co.uk> wrote:
One cause that springs to mind that would produce this behaviour is some kind of redirect (rather than rewrite) rules going on. If there are URL redirects going on somewhere in the stack, the redirected URL will always be a GET. e.g. if you had a redirect rule in apache to change URLs not ending in a slash to ending in a slash, you'd get this:

POST /some/url -> Apache response: redirect to /some/url/
GET /some/url/ -> Lucee receives this when expecting POST

Check the network tab in your browser, you'll be able to see this behaviour if that is the case.

(I've not seen this behaviour in any other scenario personally).

On 27 January 2017 at 14:26, Jason Graves <jasono...@gmail.com> wrote:

I'm building a new API server using Lucee, and I just noticed that all of my requests are coming in as GET.  I'm using Postman for testing, and when I do a POST the result via both CGI.request_method and getHttpRequestData().method are both displaying GET.

I'm running Apache2 on Ubuntu.

Anyone else run into this?

Jason








--


You received this message because you are subscribed to the Google Groups "Lucee" group.


To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.



To post to this group, send email to lu...@googlegroups.com.


To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/9398a45f-0550-42ea-a4a0-4c8f32a24222%40googlegroups.com.


For more options, visit https://groups.google.com/d/optout.





--

Dominic Watson
Technical Lead

Pixl8 Interactive, 3 Tun Yard, 
Peardon Street, London, SW8 3HT

        










--


You received this message because you are subscribed to a topic in the Google Groups "Lucee" group.


To unsubscribe from this topic, visit https://groups.google.com/d/topic/lucee/YBhKW_IL9nk/unsubscribe.


To unsubscribe from this group and all its topics, send an email to lucee+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.

To post to this group, send email to lu...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages