post - File uploading using GET Method -


as know, file uploading accomplished using post method. so, why can't get method used file uploads instead? there specific prohibition against http get uploads?

get requests may contain entity body

rfc 2616 not prevent entity body part of request. misunderstood because php muddies waters poorly-named $_get superglobal. $_get technically has nothing http get request method -- it's nothing more key-value list of url-encoded parameters request uri query string. can access $_get array if request made via post/put/etc. weird, right? not abstraction, it?

why entity body bad idea

so spec method ... well:

in particular, convention has been established , head methods should not have significance of taking action other retrieval. these methods ought considered "safe."

so important thing make sure request safe. still, prohibition "should not" ... technically http still allows requests result in action isn't strictly based around "retrieval."

of course, semantic standpoint using method named get perform action other "getting" resource doesn't make sense either.

when entity body flat-out wrong

regarding idempotence, spec says:

methods can have property of "idempotence" in (aside error or expiration issues) side-effects of n > 0 identical requests same single request. methods get, head, put , delete share property.

this means method must not have differing side-effects multiple requests same resource. so, regardless of entity body present part of request, side-effects must same. in layman's terms means if send entity body 100 times server cannot create 100 new resources. whether sent once or 100 times request must have same result. severely limits usefulness of method sending entity bodies.

when in doubt, fall safety/idempotence tests when evaluating efficacy of method , resulting side-effects.


Comments

Popular posts from this blog

ruby - Trying to change last to "x"s to 23 -

jquery - Clone last and append item to closest class -

css - Can I use the :after pseudo-element on an input field? -