PostType in DownloadFile doesn't work with hURL

Discuss about plugins that don't have a dedicated forum
Post Reply
User avatar
jPV
Posts: 603
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

PostType in DownloadFile doesn't work with hURL

Post 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"})
User avatar
airsoftsoftwair
Posts: 5443
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: PostType in DownloadFile doesn't work with hURL

Post by airsoftsoftwair »

Code: Select all

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