in src/main/scala/com/gu/fastly/api/FastlyApiClient.scala [67:84]
def packageUpload(serviceId: String, versionId: Int, `package`: File): Future[Response] = {
val apiUrl = s"$fastlyApiUrl/service/$serviceId/version/$versionId/package"
// Fastly recommend using the Expect header because it may identify issues with the request based upon
// the headers alone instead of requiring you to wait until the entire binary package upload has completed
val headers = commonHeaders ++ Map("expect" -> "100-continue", "Content-Type" -> "multipart/form-data")
val part = new FilePart("package", `package`, "application/octet-stream", StandardCharsets.UTF_8)
AsyncHttpExecutor.execute(
apiUrl,
PUT,
headers,
Map.empty,
Some(part)
)
}