Skip to content
This repository has been archived by the owner on Jun 30, 2020. It is now read-only.

MethodOverride improvements #28

Closed
designermonkey opened this issue Feb 13, 2016 · 4 comments
Closed

MethodOverride improvements #28

designermonkey opened this issue Feb 13, 2016 · 4 comments
Milestone

Comments

@designermonkey
Copy link

In my adventures, I tend to find that the use case for overriding an HTTP method comes from web browsers where we all know there is poor support for anything other than POST and GET.

I'm just wondering how useful this middleware package is when solely relying on a header to do the overriding? Generally, clients that can set headers can also make requests with deliberate HTTP methods.

Would it be possible to have this upgraded to use a POST form field, and query-string parameter alongside the header?

$getUrl = "example.com?http-method-override=HEAD";

$postBody = [
    "http-method-override" => "PUT"
];

It would become so much more useful in the wild with additions like this.

@oscarotero
Copy link
Owner

I like this idea. After a quick search I found other similar middlewares providing this feature, some only use the post body, others also the query string parameteres. What do you think about something like this?:

Middleware::methodOverride()
    ->parameter('http-method-override') //To use this parameter in the parsed body and url query 
    ->parameter('http-method-override', false) //To use only in the parsed body

@designermonkey
Copy link
Author

Yeah, that sounds great!

@oscarotero
Copy link
Owner

Released 3.14 with this feature :)

@designermonkey
Copy link
Author

Brilliant! Cheers.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants