httpverbs

Is the HTTP 'HEAD' verb useful in web development?

早过忘川 提交于 2019-12-20 08:34:59
问题 I've read the w3.org spec on the 'HEAD' verb, and I guess I'm missing something. I can't see how it would be useful. Is the HTTP 'HEAD' verb useful in web development? If so, how? 回答1: From RFC2616: This method (HEAD) can be used for obtaining metainformation about the entity implied by the request without transferring the entity-body itself. This method is often used for testing hypertext links for validity, accessibility, and recent modification. The reason why HEAD is preferred to GET is

How can I overload ASP.NET MVC Actions based on the accepted HTTP verbs?

吃可爱长大的小学妹 提交于 2019-12-18 14:15:23
问题 Wanted to use the same URL for a GET/PUT/DELETE/POST for a REST based API, but when the only thing different about the Actions is which HTTP verbs it accepts, it considers them to be duplicate! "Type already defines a member called 'Index' with the same parameter types." To which I said, so what? This one only accepts GET, this one only accepts POST... should be able to be co-exist right? How? 回答1: That's not ASP.NET MVC limitation or whatever. It's .NET and how classes work: no matter how

server error:405 - HTTP verb used to access this page is not allowed

 ̄綄美尐妖づ 提交于 2019-12-17 18:10:03
问题 I have a php Facebook application which I have uploaded in a Microsoft server. When I run the application i get this error. Does anybody know the cause of this ? 405 - HTTP verb used to access this page is not allowed. The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access. 回答1: Even if you are using IIS or apache, in my guess you are using static html page as a landing page, and by default the web server doesn't allow POST or GET

post vs. put when posting a form

﹥>﹥吖頭↗ 提交于 2019-12-12 10:03:31
问题 When evaluating that a form was submitted, I check that the method was post, not get. I was told this is a good way to know that the form was submitted by clicking the submit button and that it's not just being submitted by a script that's passing the data in the url. How about the "put" method. It seems very similar to "post". Can it be more or less be used instead of "post" without much loss in the benefits provided by "post"? 回答1: No. HTML only supports post and get as form methods, even

405 HTTP Error - PHP POST

两盒软妹~` 提交于 2019-12-12 04:14:18
问题 I have a site running on windows server 2008. The site is HTML, and has two forms which POST to PHP scripts (both to send an email). This error comes up however when I click the submit button on the page "405 - HTTP verb used to access this page is not allowed. The page you are looking for cannot be displayed because an invalid method (HTTP verb) was used to attempt access." After looking around on the web, I've tried a few solutions but none seem to work. I've tried adding a .html extension

NodeJS Express - handling 404 (Not Found) and 405 (Method Not Allowed) separatedely

末鹿安然 提交于 2019-12-11 12:58:15
问题 I'm trying to find a way to handle both 404 and 405 status code in my Express application, but handling them separatedely. e.g.: I have a router like the following: // Add routes for every path we define here. server.use('/', require('./indexRoutes')) server.use('/account', require('./accountRoutes')) // Handling route errors. server.all('*', (request, response) => response.status(404).send('Invalid route (not found).') ) However, either invalid routes or invalid HTTP verbs are being treated

Sharepoint - Multiple document upload - HTTP 'post' verb not allowed

不羁的心 提交于 2019-12-11 12:13:20
问题 When attempting to upload any number of documents, including very small files, seems to succeed- but subsequently redirects to an error page indicating the following: /_layouts/error.aspx?ErrorText=The%20HTTP%20verb%20POST%20used%20to%20access%20path%20%27%2F%5Fvti%5Fbin%2Fshtml%2Edll%2FSiteCollectionDocuments%2FForms%2FUpload%2Easpx%27%20is%20not%20allowed%2E The HTTP verb POST used to access path '/_vti_bin/shtml.dll/SiteCollectionDocuments/Forms/Upload.aspx' is not allowed. Any ideas as to

POST Requests seen as GET by server

旧巷老猫 提交于 2019-12-11 05:47:44
问题 Got a really strange problem here. When sending post requests to my PHP script $_SERVER['REQUEST_METHOD'] returns "GET" instead of "POST". It works fine for every other REST method so this is what I get GET -> GET POST-> GET PUT -> PUT DELETE -> DELETE It only happens on one of my servers so i'm assuming it's an apache problem and i've managed to figure out that it only happens if I add "www" to my url. I.e www.something.com causes the problem but something.com does not I have tested on

REST API Designing Endpoints (Action/Verb => Noun/Resource )

谁说我不能喝 提交于 2019-12-11 00:26:19
问题 According to this guide of designing REST API endpoints, we should never use action/verbs in URL (e.g. /addNewEmployee ), if we want to perform an action we should only use HTTP verbs with respective resource/noun (e.g. POST /employees ). Now, I've a resource named themes , I've created following endpoints around it: GET /themes (list all themes) GET /themes/:name (list a single theme with given name) I wanted to create another endpoint through which I can perform an action (i.e. switch theme

PATCH AJAX Request in Laravel

ぃ、小莉子 提交于 2019-12-10 19:40:22
问题 Is it possible to make AJAX PATCH requests to laravel, or am I restricted to POST? Laravel uses PATCH in input hidden fields, however, I am not using form elements—just buttons that should partially update a record when clicked (via an AJAX request). How would the route look like for this? Routes file Route::patch('questions/{id}', 'QuestionController@update')->before('admin'); I am not sure if laravel routes support PATCH. Controller public function update($id) { if (Request::ajax() &&