Python のこのコードから Erlang に切り替えたい:
パイソン:
import httplib
body="<xml>...</xml>"
headers = { \
"Accept" : "text/*" , \
"User-Agent" : "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)" , \
"Host" : "something.com" , \
"Content-Length" : str( len( body ) ) , \
"Connection" : "Keep-Alive" , \
"Cache-Control" : "no-cache" , \
}
server="something.com"
url="/s.srf"
conn = httplib.HTTPSConnection(server,443)
conn.request("POST", url, body, headers)
-> 私はこのErlangを試しました:
Headers=[
{"Accept","text/*"},
{"User-Agent","Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)"},
{"Host","something.com"},
{"Content-Length",string:len(Body)},
{"Connection","Keep-Alive"},
{"Cache-Control","no-cache"}
].
httpc:request(post,{Server,Headers,[],Body},[],[]).
しかし、URL「/s.srf」をどこに置くことができるかわかりません。何かアイデアはありますか?