Ask a Question

Uploading app package using Invoke-RestMethod or Invoke-WebRequest

Nate
Occasional Contributor

Uploading app package using Invoke-RestMethod or Invoke-WebRequest

Attempting to upload my app to BitBar using Invoke-RestMethod or Invoke-WebRequest.

Getting " : The remote server returned an error: (500) Internal Server Error."

```

$package = 'c:\my.apk'
$bitbar = 'https://cloud.bitbar.com/api/me/files/'
$user = '<key>'
$pair = "$($user):"
$encodedCreds = [System.Convert]::ToBase64String([System.Text.Encoding]::ASCII.GetBytes($pair))
$basicAuthValue = "Basic $encodedCreds"
$Headers = @{Authorization = $basicAuthValue}
Invoke-RestMethod -Method Post -Uri $bitbar -Headers $Headers -InFile $package -ContentType 'application/octet-stream'

```

I can successfully query using `Invoke-RestMethod -Method Get -Uri $bitbar -Headers $Headers`, so I know that authentication is working with $Headers and that the URL in $bitbar is valid.

3 REPLIES 3
mattb
Staff

Hi,

Does this issue still persist or was it resolved? 

Nate
Occasional Contributor

Still exists.

Id recommend to create a support ticket, and our support team will be able to provide more assistance

You can fill out a ticket here: 
https://support.smartbear.com/bitbar/message/

cancel
Showing results for 
Search instead for 
Did you mean: