Posting Zip files with HTTP Request

Found a solution! Added the RestSharp package and made the following Invoke Code activity with the following code:

var client = new RestSharp.RestClient(postEndpoint);
client.Timeout = -1;
var request = new RestSharp.RestRequest(RestSharp.Method.POST);
request.AddHeader("Authorization", String.Concat("Bearer", bearerToken));
request.AddHeader("Content-Type", "application/zip");
request.AddParameter("application/zip", System.IO.File.ReadAllBytes(filePath), RestSharp.ParameterType.RequestBody);
RestSharp.IRestResponse response = client.Execute(request);
1 Like