$ http.get,$ http.post,$ http.put,$ http.delete $ http.head和$ http.jsonp之间的区别 [英] Difference between $http.get , $http.post ,$http.put , $http.delete $http.head and $http.jsonp

查看:132
本文介绍了$ http.get,$ http.post,$ http.put,$ http.delete $ http.head和$ http.jsonp之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是angular js和Web开发的新手. 请帮助我.

I am new to angular js and web development. Please help me.

今天,我在angular js中阅读了有关$ http的信息,但我只知道get和post方法.

Today i read about $http in angular js but i am only aware about the get and post methods .

请任何人解释一下,$ http.get,$ http.post,$ http.put,$ http.delete $ http.head和$ http.jsonp有什么区别

Can Please anyone explain ,me what is the Difference between $http.get , $http.post ,$http.put , $http.delete $http.head and $http.jsonp

所有这些以及何时使用.

all of them and when to use.

谢谢.

推荐答案

当您在浏览器中输入URI或单击时,HTTP GET 请求就是您的请求(请双关语)网页上的链接.某些HTML元素(例如)也会生成GET请求. GET从服务器请求资源(通常是网页或图像).您可以通过在脚本之后添加查询参数"来将其他信息传递到服务器端脚本,例如example.com?foo&bar=42.

An HTTP GET request is what you get (pardon the pun) when you enter a URI in your browser or when you click on a link on a web page. Certain HTML elements, like also generate GET requests. GET requests a resource (usually a web page or an image) from the server. You can pass additional information to a server-side script by adding 'query parameters' after the script, such as example.com?foo&bar=42.

POST 请求类似于GET请求.不同之处在于,任何其他信息都是在请求的正文中发送的,而不是作为URI的一部分发送的.您可以使用HTML中的元素生成POST请求,其中表单字段值在请求正文中发送.

A POST request is similar to a GET request. The difference is that any additional information is sent in the body of the request, rather than as part of the URI. You can generate POST requests using elements in HTML, where the form field values are sent in the request body.

HEAD 请求也类似于GET请求,但是服务器仅使用HTTP标头进行响应;响应主体为空.

A HEAD request is also similar to a GET request, but the server responds only with the HTTP headers; the response body is empty.

PUT 请求是一种将文件上传到服务器的方法.出于安全考虑,大多数服务器不允许PUT请求.

A PUT request is a way to upload a file to a server. Most servers don't allow PUT requests, because of the security implications.

类似地,删除请求将删除服务器上的资源.与PUT一样,出于明显的原因,这种方法很少在服务器上允许使用.

Similarly, a DELETE request will delete a resource on the server. Like PUT, this method is rarely permitted on server for obvious reasons.

来源:对于jsonp,我想说一下维基百科的解释.但这基本上是一种允许您通过XMLHttpRequest进行跨域请求的技术.

For jsonp I would say to take a look at wikipedia explanation. But it's basically a technique that allows you to make cross-domain requests via XMLHttpRequest.

这篇关于$ http.get,$ http.post,$ http.put,$ http.delete $ http.head和$ http.jsonp之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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