头与在HttpSendRequest函数中设置的标头之间有什么区

头与在HttpSendRequest函数中设置的标头之间有什么区

本文介绍了使用HttpAddRequestHeaders设置的标头与在HttpSendRequest函数中设置的标头之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在试图找出设置我的http标头的正确位置。 WinInet API有两个功能,我可以设置它们。使用
设置标题 HttpAddRequestHeaders 就像魅力一样,但是,例如,如果我
移动我的内容类型:text / XML; charset = utf-8 标题(在 HttpAddRequestHeaders 之前成功设置)到
HttpSendRequest lpszHeaders参数)我收到错误
12150 ERROR_HTTP_HEADER_NOT_FOUND )。为什么?
b
$
我猜,有一些特殊的"种类"我可以用HttpSendRequest设置的标题......但我不知道......任何人都可以解释一下吗?



Carlos Barreto Feitoza Filho - Delphi开发人员

解决方案

I'm trying to figure what is the correct place to set my http headers. The WinInet API has two functions where I can set them. Setting the headers withHttpAddRequestHeaders works like a charm, but, for example, if Imove my Content-Type: text/xml; charset=utf-8 header (successfully set before with HttpAddRequestHeaders) toHttpSendRequest (lpszHeaders parameter) I receive the error12150 (ERROR_HTTP_HEADER_NOT_FOUND). Why?

I guess, so, that there are some special "kind" of headers I can set with HttpSendRequest... But I do not know... Can anyone explain?

Carlos Barreto Feitoza Filho - Delphi Developer

解决方案


这篇关于使用HttpAddRequestHeaders设置的标头与在HttpSendRequest函数中设置的标头之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-04 15:44