Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all articles
Browse latest Browse all 12506

Help with POSTing image to imgur [winhttp]

$
0
0
I've been trying to uplaod a picture to imgur.com with functions from winhttp.au3

Examples using curl use the -F switch to POST form data. So I tried the same with _WinHttpSimpleFormFill to imgur.com/api/upload.xml.
..and @error is set to 1. No form on that page? The what does curl do :huh2:   I sure am missing something. Help a bit?

[ autoit ]      
Global $hOpen = _WinHttpOpen(" Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) (Prevx 3.0.5) ") ; Get connection handle Global $hConnect = _WinHttpConnect( $hOpen, "imgur.com" ) Global $sHTM = _WinHttpSimpleFormFill( $hConnect, "api/upload.xml", "index:0", "name:key", "b3625162d3418ac51a9ee805b1840452", "name:image", _PathFull($tempfile) ) If @error Then MsgBox(68, "", "Error" & @error) ConsoleWrite( $sHTM ) ; Close handles _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen)

Viewing all articles
Browse latest Browse all 12506

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>