除了GET和POST之外,你如何从浏览器向RESTful应用程序发送任何内容? [英] How do you send anything beside GET and POST from browser to your RESTful app?

查看:149
本文介绍了除了GET和POST之外,你如何从浏览器向RESTful应用程序发送任何内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我没有得到RESTful的东西。是的,我知道如何从我的浏览器向我的应用程序发送GET请求。这是通过URL链接。

I am not gettng the RESTful thing. Yes, I know how to send a GET request to my app from my browser. It's through URL linking.

<a href="/user/someone">

还可以通过表单方式发送POST请求。

And can also send POST requests through form method.

<form method="post">

除此之外,我知道浏览器有时会发送HEAD命令来确定页面状态,但是最终用户无法控制。

Beside that I know browsers sometimes send HEAD command to figure out page status, but on which the end user has no control.

然后我正在阅读的那些DELETE和PUT命令是什么?如何从浏览器向RESTful应用程序发送DELETE命令?

Then what are those DELETE and PUT commands I am reading of? How do you send, for example a DELETE command from your browser to your RESTful application?

推荐答案

HTML 4.01规范仅描述 GET POST 作为有效值方法属性。所以在HTML中,到目前为止还没有办法描述其他方法。

The HTML 4.01 specification describes only GET and POST as valid values for the method attribute. So in HTML there is no way of describing other methods than this by now.

HTML 5规范(目前只是一个工作草案)确实命名 PUT DELETE 有效值

But the HTML 5 specification (currently just a working draft) does name PUT and DELETE as valid values.

查看 XMLHttpRequest对象规范(目前只是一个工作草案)用于JavaScript中的异步请求( AJAX ),它支持 PUT DELETE 方法同样,但没有说明当前浏览器的实际支持。

Taking a look into the XMLHttpRequest object specification (currently just a working draft too) used for asynchronous requests in JavaScript (AJAX), it supports the PUT and DELETE methods too, but doesn’t say anything about the actual support by current browsers.

这篇关于除了GET和POST之外,你如何从浏览器向RESTful应用程序发送任何内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆