消息数据中包含的标题?

问题描述

我已经使用 cpprestsdk 实现了一个休息服务器。

这是标题信息:

Content-disposition: form-data; name="image"; filename="screenshot.png"
Content-Type: application/octet-stream

在 PUT 请求中使用 extract_string()extract_vector() 时。我正在将此标头数据与消息数据混合在一起。

示例:

--------------------------f6769472688cb572^M
Content-disposition: form-data; name="image"; filename="screenshot.png"^M
Content-Type: application/octet-stream^M
^M
<89>PNG^M
^Z
@ @ @ @ @ @ @ @
--------------------------f6769472688cb572^M

这里,我认为前 4 行不应该存在。 我需要为此编写一个单独的解析器吗?或者 cpprestsdk 是否为此提供了一些东西?

我正在使用 curl 向服务器发送请求。这是 curl 命令:

curl -X PUT -H "Content-Type: applictaion/octet-stream" -F "image=@/image-file.png" "localhost:/"

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)