Advertisement
MBrendecke

Challenge 6 - AutoIt

Aug 9th, 2018
183
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <Mathematische Funktionen.au3>
  2. ;~  #include <Needed Libarys/JSON.au3>
  3.  
  4. MsgBox(0, "Test", _sendBinary(_binary(_getDezimal())))
  5.  
  6. Func _getDezimal()
  7.     $oHTTP = ObjCreate('winhttp.winhttprequest.5.1')
  8.     $oHTTP.open('GET', "https://cc.the-morpheus.de/challenges/6/")
  9.     $oHTTP.send()
  10.     $oHTTP.WaitForResponse()
  11.     Return $oHTTP.ResponseText()
  12. EndFunc
  13.  
  14. Func _sendBinary($Binary)
  15.     $oJson = '{ "token": "' & $Binary & '" }'
  16.  
  17.     $oHTTP = ObjCreate('winhttp.winhttprequest.5.1')
  18.     $oHTTP.open("POST", "https://cc.the-morpheus.de/solutions/6/", False)
  19.     $oHTTP.SetRequestHeader("Content-Type", "application/json;charset=utf-8")
  20.  
  21.     ConsoleWrite("Send: " & $oJson & @CRLF)
  22.     $oHTTP.send($oJson)
  23.     $oHTTP.WaitForResponse()
  24.  
  25.     Return $oHTTP.ResponseText()
  26. EndFunc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement