Can someone help me to create classic asp code from the CURL request below?
curl -H 'Authorization: Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd' "https://cloud.seafile.com/api2/beshared-repos/"
I tried the sample code below, but it didn't work.
Dim http: Set http = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
Dim url: url = "https://cloud.seafile.com/api2/beshared-repos/"
Dim data: data = "token=f2210dacd9c6ccb8133606d94ff8e61d99b477fd"
With http
Call .Open("GET", url, False)
Call .SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
Call .SetRequestHeader("Authorization", "Token f2210dacd9c6ccb8133606d94ff8e61d99b477fd")
Call .Send()
End With
If Left(http.Status, 1) = 2 Then
'Request succeeded with a HTTP 2xx response, do something...
Else
'Output error
Call Response.Write("Server returned: " & http.Status & " " & http.StatusText)
End If
And it throws the below error message at line Call.Send()
WinHttp.WinHttpRequest error '80090326'
The message received was unexpected or badly formatted.