PostType in DownloadFile doesn't work with hURL
Posted: Tue Apr 19, 2022 1:38 pm
The PostType option in DownloadFile() doesn't work when using the hURL adapter, you get "Content-Type: application/x-www-form-urlencoded" always. This can be worked-around with the CustomHeaders though...
Code: Select all
@REQUIRE "hurl"
; PostType doesn't work with hurl (works with the "default" adapter)
DownloadFile("http://ptsv2.com/t/hollyw/post" , {Post="{\"test\": 1}", PostType="application/json", Verbose=True, Adapter = "hurl"})
Wait(50)
; A work-around for hurl, don't use with "default" to avoid double headers
DownloadFile("http://ptsv2.com/t/hollyw/post" , {Post="{\"test\": 2}", CustomHeaders = "Content-Type: application/json\r\n", Verbose=True, Adapter = "hurl"})