我試圖將一些代碼從shell腳本移動到erlang以獲取新的內部工具。喜歡在Erlang中使用捲曲
當前的shell腳本調用捲曲這樣的:
curl \
--header "Content-type: text/xml; charset=utf-8" \
--data @$OTAR_SOAP_FILE \
--output $OTAR_OUT_FILE \
--stderr $OTAR_ERR_FILE \
--insecure \
$OTAR_URL
我希望能夠從使用inets'庫二郎這樣做。
這是我這麼遠,但它不工作:
stress(Url, Message, ConcurrentAttempts, Attempts) ->
setup_connection(),
{ok, {{Version, ResponseCode, ReasonPhrase}, Headers, Body}} =
httpc:request(get, {Url, [], "text/xml", Message}).
在這種情況下,URL是一樣的$ OTAR_URL和消息是$ OTAR_SOAP_FILE內容。
如何通過curlang從erlang中的soap文件傳遞OTAR_URL的數據?
你可以舉一個使用httpc:request/4的例子嗎?我是erlang的新手,它的文檔有點不透明。 – Malfist 2012-03-29 12:12:44
'httpc:request(get,{「http://www.google.com」,[]},[],[])。' – 2012-03-29 12:51:03
我明白,但是如何將字符串傳遞給一堆數據在GET? – Malfist 2012-03-29 13:05:19