获得与POST的AJAX? [英] GET vs POST in AJAX?

查看:162
本文介绍了获得与POST的AJAX?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为什么那里得到和AJAX POST请求,因为它不影响页面的网址呢?它通过在得到AJAX传递敏感数据会有什么不同的数据没有得到反映到页面的网址?

Why are there GET and POST requests in AJAX as it does not affect page URL anyway? What difference does it make by passing sensitive data over GET in AJAX as the data is not getting reflected to page URL?

推荐答案

您应该根据你从你的Web服务需要使用适当的HTTP动词。

You should use the proper HTTP verb according to what you require from your web service.

当处理一个集合的URI,如: http://example.com/resources/

When dealing with a Collection URI like: http://example.com/resources/

GET :列出集合的成员,完成其成员的URI进一步导航。例如,列出所有的汽车销售。

GET: List the members of the collection, complete with their member URIs for further navigation. For example, list all the cars for sale.

PUT :含义定义为与另一个集合替换整个集合

PUT: Meaning defined as "replace the entire collection with another collection".

发表:创建其中ID是由集合自动分配集合中的一个新条目。创建的ID通常包括作为由该操作返回的数据的一部分。

POST: Create a new entry in the collection where the ID is assigned automatically by the collection. The ID created is usually included as part of the data returned by this operation.

删除:含义定义为删除整个集合

DELETE: Meaning defined as "delete the entire collection".

在与会员 URI就像对付: http://example.com/resources/7HOU57Y

When dealing with a Member URI like: http://example.com/resources/7HOU57Y

GET :检索pssed在合适的MIME类型集合EX $ P $的处理部件的再presentation

GET: Retrieve a representation of the addressed member of the collection expressed in an appropriate MIME type.

PUT :更新集合的解决成员或与指定的ID创建

PUT: Update the addressed member of the collection or create it with the specified ID.

发表:对待处理的成员作为在自己的权利的集合,并创建了一个新的下级

POST: Treats the addressed member as a collection in its own right and creates a new subordinate of it.

删除:删除收集的解决成员

DELETE: Delete the addressed member of the collection.

来源:<一href="http://en.wikipedia.org/wiki/Re$p$psentational%5FState%5FTransfer#RESTful%5Fweb%5Fservices">Wikipedia

这篇关于获得与POST的AJAX?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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