2017-09-25 72 views
0

我有一个用-k调用的curl配置文件,它工作正常;curl - 具有多个头文件的配置文件

url = "http://some-url" 
header = "Content-Type: text/xml; charset=utf-8" 
silent 
show-error 

的问题是我想添加第二个hesder项针对特定具体SOAP动作(的SOAPAction:金塔:....),我似乎无法得到正确的语法。我已经尝试过这个以及其他许多变体!

header = "Content-Type: text/xml; charset=utf-8, SOAPAction: 
urn:IProductsService/HAL_DiscountUpdate" 

但这不起作用。我也尝试过这里的建议; how do I set a custom header in a curl config file,这似乎也不工作。

我错过了什么吗?

我可以得到;

curl -v -H 'SOAPAction: urn:MySOAPACTION' --config my_curl.cfg 

工作正常,但我真的需要它在配置文件。

谢谢。

+0

只需为要添加的每个头添加一个'header ='行! –

+0

是的,那工作,谢谢! :-) –

回答

0

只需为要添加的每个新标题添加一个header =行即可。为了将你的配置文件从问题扩展到传递你的鞋号:

url = "http://some-url" 
header = "Content-Type: text/xml; charset=utf-8" 
header = "Shoe-size: 10" 
silent 
show-error