post

HTTP请求:GET和POST的区别

风格不统一 提交于 2020-01-16 08:26:57
根据 HTTP 规范,GET 用于信息获取,而且应该是安全的和幂等的。 根据 HTTP 规范,POST 表示可能修改变服务器上的资源的请求。 首先是 “GET 方式提交的数据最多只能是 1024 字节”,因为 GET 是通过 URL 提交数据,那么 GET 可提交的数据量就跟 URL 的长度有直接关系了。而实际上,URL 不存在参数上限的问题,HTTP 协议规范没有对 URL 长度进行限制。这个限制是特定的浏览器及服务器对它的限制。IE 对 URL 长度的限制是 2083 字节(2K+35)。对于其他浏览器,如 Netscape、FireFox 等,理论上没有长度限制,其限制取决于操作系统的支持。注意这是限制是整个 URL 长度,而不仅仅是你的参数值数据长度。 POST 是没有大小限制的,HTTP 协议规范也没有进行大小限制 来源: CSDN 作者: 量子计算机牛逼 链接: https://blog.csdn.net/qq_41877948/article/details/103991189

GET or POST when reading request body

狂风中的少年 提交于 2020-01-16 07:58:42
问题 Should I use the GET or POST method when sending information to a server in the body of the HTTP request? There are no query parameters appended to the URL, the server will inspect the body of the request for what it needs. 回答1: GET extracts parameters from the request URL. POST extracts parameters from the request body. So you need POST. 回答2: A nice description and interesting discussion on the topic: http://thinkvitamin.com/code/the-definitive-guide-to-get-vs-post/ 回答3: POST should be used

Changing GET to POST in Python (Flask)

不羁岁月 提交于 2020-01-16 05:16:08
问题 I am trying to create a simple app where an array of integers is generated on the server and sent to the client. Here is some sample (working) code in app.py: from flask import Flask, render_template, request, url_for import random app = Flask(__name__) @app.route('/') def form(): s_abc = [random.random() for _ in range(40)] return render_template('abc.html', s_abc=s_abc) if __name__ == '__main__': app.run(debug=True) And here is a (working) snippet of abc.html: <div> {{s_abc}} </div> The

Http Post with Blackberry 6.0 issue

蹲街弑〆低调 提交于 2020-01-16 05:01:05
问题 I am trying to post some data to our webservice(written in c#) and get the response. The response is in JSON format. I am using the Blackberry Code Sample which is BlockingSenderDestination Sample. When I request a page it returns with no problem. But when I send my data to our webservice it does not return anything. The code part that I added is : ByteMessage myMsg = bsd.createByteMessage(); //myMsg.setStringPayload("I love my BlackBerry device!"); myMsg.setMessageProperty("querytpe",

Swift + ios 9, sending post data with base64 image data

心不动则不痛 提交于 2020-01-16 04:42:06
问题 I have looked at the different questions related to send a post request with NS on swift. I am having issues however with the following code where the responding server doesn't even see it as being a post request. What am I missing: var request = NSMutableURLRequest(URL: NSURL(string: url)!) request.HTTPMethod = "POST" request.addValue("application/json", forHTTPHeaderField: "Content-Type") request.addValue("application/json", forHTTPHeaderField: "Accept") var imageData =

Error 324 (net::ERR_EMPTY_RESPONSE) when posting from PHP page or to PHP page

北战南征 提交于 2020-01-16 03:54:08
问题 This morning we found an issue with many of the pages on our website when trying to submit a form. If the form is on a PHP page, or submitting to a PHP page, we would receive an error "Error 324 (net::ERR_EMPTY_RESPONSE)". I have two examples. One an HTML page submitting to itself, another a PHP page submitting to itself. http://fun2dip.com/query.html http://fun2dip.com/query.php The HTML page submits without problem, the PHP page receives the above error. The pages are identical other than

网站搭建 (第08天) 阅读计数优化

我与影子孤独终老i 提交于 2020-01-16 02:30:13
一、前言   上篇写了几个简单的阅读计数功能实现,其缺点都是无法统计某一天的阅读数量,也就无法根据日期来对热门博客进行排行。所以最好还是重建一个带有日期字段名的模型表,这就可以根据日期条件来筛选博客的阅读次数了,比较方便统计。 二、新建ReadDetail模型类   ReadNum继续保留,再建一个ReadDetail模型类。 from django.db import models from django.contrib.contenttypes.fields import GenericForeignKey from django.contrib.contenttypes.models import ContentType class ReadDetail(models.Model): """ 根据日期计数的模型类 继承model.Model模型类 """ read_num = models.IntegerField(default=0) date = models.DateField(default=timezone.now) content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE) object_id = models.PositiveIntegerField() content

Passing MySQL query via Javascript

这一生的挚爱 提交于 2020-01-16 01:04:29
问题 In a Javascript function, I have the following JQuery in which I call a PHP script (i.e. getDBData.php) to get the database data from the query: $("#dbcontent").load("getDBData.php", {query: "SELECT * FROM `texts` WHERE name='John' LIMIT 10;"}); In getDBData, I fetch this query via POST: $query = $_POST['query']; and give it as input for mysql_query: $query = mysql_query($query) or die(mysql_error()); However, I get the following MySQL error: You have an error in your SQL syntax; check the

How to set POST data to URL and get results in string variable

假装没事ソ 提交于 2020-01-16 00:54:12
问题 I am trying to get a POST result but the server has block it. I have tried with fsockopen curl file_get_contents but I got a same result from the server as an eroor massage of "Access denied" . Is there any way to get the POST results from the block server. <?php $post_arr = array ("regno" => "1"); $addr = 'url'; $fp = fsockopen($addr, 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)<br />\n"; } else { $req = ''; foreach ($post_arr as $key => $value) { $value = urlencode

Error in uploading post via Blogger API v1

跟風遠走 提交于 2020-01-15 18:51:12
问题 I'm trying to upload a post to my Blogger blog, yet I'm having an error. I'm using Eclipse and the libraries referesed are: google-oauth-java-client-1.17.0-rc and gdata-src.java-1.47.1. Code: import com.google.gdata.client.GoogleService; import com.google.gdata.data.Entry; import com.google.gdata.data.PlainTextConstruct; import com.google.gdata.util.ServiceException; import java.io.IOException; import java.net.URL; public class Blogger { public static void createPost(GoogleService myService)