Page 1 of 1

PostType in DownloadFile doesn't work with hURL

Posted: Tue Apr 19, 2022 1:38 pm
by jPV
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"})

Re: PostType in DownloadFile doesn't work with hURL

Posted: Wed Apr 20, 2022 6:23 pm
by airsoftsoftwair

Code: Select all

- Fix: DownloadFile()'s "PostType" tag wasn't supported by hURL