【转】What's the difference between put and post

1、GET请求会向数据库发索取数据的请求,从而来获取信息,该请求就像数据库的select操作一样,只是用来查询一下数据,不会修改、增加数据,不会影响资源的内容,即该请求不会产生副作用。无论进行多少次操作,结果都是一样的。

2、与GET不同的是,PUT请求是向服务器端发送数据的,从而改变信息,该请求就像数据库的update操作一样,用来修改数据的内容,但是不会增加数据的种类等,也就是说无论进行多少次PUT操作,其结果并没有不同。

3、POST请求同PUT请求类似,都是向服务器端发送数据的,但是该请求会改变数据的种类等资源,就像数据库的insert操作一样,会创建新的内容。几乎目前所有的提交操作都是用POST请求的。

4、DELETE请求顾名思义,就是用来删除某一个资源的,该请求就像数据库的delete操作。

就像前面所讲的一样,既然PUT和POST操作都是向服务器端发送数据的,那么两者有什么区别呢。。。POST主要作用在一个集合资源之上的(url),而PUT主要作用在一个具体资源之上的(url/xxx),通俗一下讲就是,如URL可以在客户端确定,那么可使用PUT,否则用POST。

【转】What's the difference between put and post

时间: 2024-10-27 13:45:17

【转】What's the difference between put and post的相关文章

python: the difference between append and extend

Data Analysis: indoor localization using received signal strength (RSS) An error about list operation in python: append and extend elements We define a list A to storage objects, which the length is unknown, and list B and C to storage the final resu

389. Find the Difference

Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at a random position. Find the letter that was added in t. Example: Input: s = "abcd" t = "ab

The Difference Between a Router, Switch and Hub

Some technicians have a tendency to use the terms router, switch and hub interchangeably,  but have you ever wondered what the difference is? Some technicians have a tendency to use the terms router, hub and switch interchangeably. One minute they're

Leetcode 530. Minimum Absolute Difference in BST

Given a binary search tree with non-negative values, find the minimum absolute difference between values of any two nodes. Example: Input: 1 3 / 2 Output: 1 Explanation: The minimum absolute difference is 1, which is the difference between 2 and 1 (o

The difference of Methods and Functions

Functions Functions are self-contained chunks of code that perform a specific task. You give a function a name that identifies what it does, and this name is used to “call” the function to perform its task when needed. Swift’s unified function syntax

lintcode 中等题:maximum subarray difference 最大子数组差

题目 最大子数组差 给定一个整数数组,找出两个不重叠的子数组A和B,使两个子数组和的差的绝对值|SUM(A) - SUM(B)|最大. 返回这个最大的差值. 样例 给出数组[1, 2, -3, 1],返回 6 注意 子数组最少包含一个数 挑战 时间复杂度为O(n),空间复杂度为O(n) 解题 刚做了数组中两个子数组和的最大值,这一题是求差,感觉上题的求解思想应该是可以用的 A B 分别是两个子数组的和,则: 所以 当A>B 的时候A越大越好 B越小越好 当A<B 的时候B越大越好 A越小越好

[转载]Difference between &lt;context:annotation-config&gt; vs &lt;context:component-scan&gt;

在国外看到详细的说明一篇,非常浅显透彻.转给国内的筒子们:-) 原文标题: Spring中的<context:annotation-config>与<context:component-scan>到底有什么不同? 原文出处:http://stackoverflow.com/a/7456501 <context:annotation-config> is used to activate annotations in beans already registered in

Set Difference(所有子集的最值差)

点击打开题目链接https://www.codechef.com/problems/SETDIFF Set Difference Problem code: SETDIFF SUBMIT ALL SUBMISSIONS All submissions for this problem are available. Churu is working as a data scientist in Coderpur. He works on a lot of data on the daily bas

HDU 4715 Difference Between Primes (素数表+二分)

Difference Between Primes Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 2998    Accepted Submission(s): 850 Problem Description All you know Goldbach conjecture.That is to say, Every even inte

difference between char *s and char s[ ]

The difference here is that : char *s = "hello,world!"; will place hello,world in read-only part of the memmory and makes s a pointer to that. making any writing operation on this illigal. while: char s[] = "hello,world!"; will puts th