WebKitFormBoundary之后的随机字符串是什么意思? [英] What does the random string after a WebKitFormBoundary do \ mean?

查看:460
本文介绍了WebKitFormBoundary之后的随机字符串是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用BI工具来自动化从数据库系统中提取数据,然后通过HTTP POST将其上传到网站的过程。

I'm trying to use a BI tool to automate a process which extracts data from our DB system, and then upload it to a web site via HTTP POST.

我使用的BI工具允许我将Request构造为文本对象,然后将其发送到Web资源。

The BI Tool I'm using allows me to build the Request up as a text object which it will then send to the web resource.

要完成此工作,我使用Fiddler捕获当我手动填写表单时Chrome发送的Web请求。

To get this working I use Fiddler to capture the web request that Chrome sent when I filled in the form manually.

该请求包含以下内容...

The request contains the following...

------WebKitFormBoundarycwwJjby5xTdrlr48
Content-Disposition: form-data; name="upload"; filename="data.csv"
Content-Type: application/vnd.ms-excel

CSV HEADER DATA 
CSV ROW DATA

------WebKitFormBoundarycwwJjby5xTdrlr48
Content-Disposition: form-data; name="returnErrorCsv"


------WebKitFormBoundarycwwJjby5xTdrlr48
Content-Disposition: form-data; name="returnUrl"


------WebKitFormBoundarycwwJjby5xTdrlr48
Content-Disposition: form-data; name="entityPropertiesToReturn"


------WebKitFormBoundarycwwJjby5xTdrlr48

然后,我得到了BI工具来模仿上面的请求,并替换从数据库中提取的数据(CSV HEADER DATA和CSV ROW DATA数据将进入该位置-该数据是机密的,因此我必须将其删除)。

I then got the BI Tool to mimic the request above and substitute in the data had extracted from the DB (where the CSV HEADER DATA and CSV ROW DATA Data would go - this data is confidential so I've had to remove it).

这一切正常,但是我的问题是WebKitFormBoundary之后的字符串是什么意思? I.E cwwJjby5xTdrlr48

This is all working ok but my question is what does the string after WebKitFormBoundary mean? I.E cwwJjby5xTdrlr48

这只是一个随机字符串,用于识别另一个请求?还是有其他目的?

It is just a random string to identify one request from another? Or does it have another purpose?

此刻,我在所有请求中都使用cwwJjby5xTdrlr48,它似乎可以正常工作,但我认为可能值得问一问,是否应该构建我的

At the moment I'm re-using cwwJjby5xTdrlr48 in all of my requests and it seems to be working ok but I thought it might be worth asking if I should construct my own string instead.

推荐答案

这只是在mime结构的不同部分之间所谓的边界的典型方式定义。由此,接收方可以区分不同的部分。

That's just the typical way of how a so called "boundary" between different parts of a mime structure is defined. The receiving side can tell the different parts apart by this. Same logic is used in different things, email messages too for example.

随机字符串确实是随机的,使用相同字符串的所有边界标记都被分组,所以在相同的水平上工作。 Mime零件结构可以分层方式堆叠。在这种情况下,将不同的随机字符串用于不同的级别以区分它们。例如,这是如何引用电子邮件作为新电子邮件的附件。如果引用的电子邮件包含多个mime部分,则它们的边界必须与新电子邮件的边界不同,否则级别之间会产生混淆。

That "random" string is indeed random, all boundary markers using an identical string are "grouped", so working on the same level. Mime part structures can stacked in a hierarchical manner. In such case different random strings are used in different levels to tell them apart. This is for example how citing an email as attachment to a new email. If the cited email contains multiple mime parts, their boundaries must be different to those of the new email, otherwise confusion would arise between the levels.

实际上,重要的不是边界的随机部分。整个字符串匹配。出于惯例的原因,每个软件都为此类边界使用唯一的前缀字符串只是一个惯例。但是通常,唯一的要求是所选字符串在所有包含的数据中必须是唯一的。显然,唯一的区别在于相应的边界必须使用完全相同的字符串。

Actually it is not the "random part" of that boundary that counts. The whole string is matched. It is simply a convention that each software uses a unique prefix string for such boundaries for transparency reasons. But in general the only requirement is that the chosen string must be unique throughout all contained data. Unique obviously except for the corresponding boundaries which must use exactly the same string.

这篇关于WebKitFormBoundary之后的随机字符串是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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