Given api docs for logging in like this:
curl -X POST --user email@company.com:password “https://api.company.com/v1/login.json”
I’m trying to use the MBS Curl plugin, but I keep getting a 400 Bad Request back.
Here’s what I’m trying:
dim c as new MyCurl
dim cacert as FolderItem = GetFolderItem(“cacert.pem”)
c.OptionHTTPAuth = 1
c.OptionVerbose=true
c.OptionURL = “https://api.company.com/v1/login.json”
c.OptionUsername = “email@company.com:myPassword”
c.OptionPost = true
c.CollectDebugData = True
c.CollectOutputData = true
c.OptionHeader=true
c.CollectHeaderData = true
c.OptionSSLVerifyHost = 2 // verify server
c.OptionSSLVerifyPeer = 1 // proofs certificate is authentic
c.OptionCAInfo = cacert.ShellPath
dim e as integer = c.Perform
msgbox "Result: "+str(c.Perform)
system.DebugLog(c.OutputData)
Any obvious problem I missed?
I also tried setting the password separately with c.OptionPassword, but same result.
In a possible outdated tutorial video, they used c.OptionUsernamePassword, with the username and password concatenated with a colon, but that option seems to no longer exist in the latest version of the plugin.