I am using this:
https://deciacco.github.io/posts/ahkgithubprivate/
To try and grab a file from my private repository, the process getting stuck at the 2nd set of requests and I don't know why:
Code: Select all
request.option(6) := 0 ;no redirects
request.open("GET", g_url, false)
request.setrequestheader("Authorization", "token " . g_token)
request.setrequestheader("Accept", "application/octet-stream")
request.send() ;FIRST request gets the 302 redirect to AWS
if (request.responsetext = "failed" || request.status != 302 || comobjtype(request.responsestream) != 0xd) {
FileAppend, % "Error:`r`n"
. "Status: `r`n" . request.status . "`r`n"
. "Headers: `r`n" . request.getallresponseheaders() . "`r`n"
. "Response: `r`n" . request.responsetext
. "`r`n", *
msgbox failed ;added for testing - I am being stopped here.
}
else
{
msgbox success ;added for testing
The file I want to grab is called Test.exe and the repository is called TT, and the branch is called TestB.
These are my globals:
Code: Select all
global g_url := "https://api.github.com/repos/Sn0wy0wl/TT/releases"
global g_file := "Test.exe"
global g_saveto := A_Desktop . "\" . g_file
global g_token := "myToken" ;Hiding for security.
Where am I going wrong here?