AJAX,RESTful/Rest,JSON和JSONP有什么区别? [英] What is the difference between AJAX, RESTful/Rest, JSON and JSONP?

查看:293
本文介绍了AJAX,RESTful/Rest,JSON和JSONP有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对这些术语感到困惑.有人可以提供/解释我的例子吗?

I am just confused with the these terms. Can anybody please provide/explain me brief with an example?

推荐答案

  • Ajax - 异步Javascript和XML". Ajax宽松地定义了一组技术,以帮助使Web应用程序呈现更丰富的用户体验.屏幕上的数据更新和刷新是使用javascript和xml(或json或只是普通的http帖子)异步完成的.

    • Ajax - "Asynchronous Javascript and XML". Ajax loosely defines a set of technologies to help make web applications present a richer user experience. Data updating and refreshing of the screen is done asynchronously using javascript and xml (or json or just a normal http post).

      JSON -"JavaScript对象表示法". JSON就像xml一样,可以用于描述对象,但是它更紧凑,并且具有成为实际JavaScript的优势.可以将以JSON表示的对象转换为实际对象,以便在javascript代码中进行操作.

      JSON - "Javascript Object Notation". JSON is like xml in that it can be used to describe objects, but it's more compact and has the advantage of being actual javascript. An object expressed in JSON can be converted into an actual object to be manipulated in javascript code.

      默认情况下,Ajax请求必须在请求发起页面的同一域中发生. JSONP -创建带有填充的JSON"-允许您请求JSON资源来自不同的域. ( CORS 是JSONP的更新更好的替代方法.)

      By default, Ajax requests have to occur in the same domain of the page where the request originates. JSONP - "JSON with padding" - was created to allow you to request JSON resources from a different domain. (CORS is a newer and better alternative to JSONP.)

      REST -代表性状态转移".使用REST原理的应用程序具有一个Url结构和一个围绕资源使用的请求/响应模式.在纯模型中,HTTP动词的Get,Post,Put和Delete用于分别检索,创建,更新和删除资源.通常不使用放置"和删除",而将获取"和发布"留给地图以选择(GET)以及创建,更新和删除(POST)

      REST - "Representational State Transfer". Applications using REST principles have a Url structure and a request/response pattern that revolve around the use of resources. In a pure model, the HTTP Verbs Get, Post, Put and Delete are used to retrieve, create, update and delete resources respectively. Put and Delete are often not used, leaving Get and Post to map to select (GET) and create, update and delete (POST)

      这篇关于AJAX,RESTful/Rest,JSON和JSONP有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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