HttpRequest multiPart/form-data
Posted: Mon Dec 09, 2024 2:27 pm
Hi,
I'm trying to connect to an Aruba 6300 switch using the REST API. It works fine with this CURL command :
It also works with this PowerShell command :
but I'm having trouble with it in PureBasic using HttpRequest(#PB_HTTP_Post, ...). I'm able to connect to other Aruba switch models this way (using the data$ parameter to pass the ID and password in JSON format).
Here is the doc : https://www.arubanetworks.com/techdocs/ ... v10-0x.pdf
Could you help me?
Thanks for you time
I'm trying to connect to an Aruba 6300 switch using the REST API. It works fine with this CURL command :
Code: Select all
curl -k -X POST -c c:\auth_cookie -H "Content-Type: multipart/form-data" "https://192.168.1.254/rest/v10.11/login" -F "username=admin" -F "password=123456"Code: Select all
Invoke-RestMethod "https://192.168.1.254/rest/v10.11/login" -SkipCertificateCheck -Method Post -Body @{username = "admin"; password = "123456"}Here is the doc : https://www.arubanetworks.com/techdocs/ ... v10-0x.pdf
Could you help me?
Thanks for you time