如何确定要提交的HTTP POST事务的大小? [英] How do I determine the size of a HTTP POST transaction to be submitted?

查看:94
本文介绍了如何确定要提交的HTTP POST事务的大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想确定要提交的HTTP POST事务的te大小(以字节为单位?)。我有一个包含大量表单数据的表单。当所有字段都填充了最大字符数(例如全部9个字符)并且表单通过POST方法提交时,没有问题,所有数据都会被保存。

I would like to determine te size (in bytes?) of a HTTP POST transaction to be submitted. I have a form with a lot of form data. When all fields are filled with the maximum number of characters (for example all 9's) and the form gets submitted through a POST method, there's no problem, and all data gets saved.

当我用空格替换所有字符(9)时,我在提交表格后得到404.

When I replace all characters (9's) by spaces, I get a 404 after submitting the form.

我假设我在这里发送了太多数据。我认为空格正在转换为%20,因此发布的字节数增加了三倍。

I'm assuming that I'm sending too much data here. I think the spaces are being converted to %20, so the amount of bytes posted are tripled.

我想在提交之前确定HTTP POST事务的大小表单,所以如果大小超过某个限制,我可以向用户显示一条消息。我更喜欢使用JavaScript。

I would like to determine the size of the HTTP POST transaction, before submitting the form, so I can display a message to the user if the size is over some limit. I'd prefer to use JavaScript.

有谁知道如何确定这个?

Does anyone know how to determine this?

推荐答案

404错误表示您尝试发布到的位置不存在,即当您使用空格发布时,网址可能会格式错误。

A 404 error indicates that the location you are trying to post to does not exist, i.e. the URL may be malformed when you post with spaces.

你能告诉我们代码吗?

这篇关于如何确定要提交的HTTP POST事务的大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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