Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save jacobsapps/5d6c9df3200fd70b0fbe32cc02713e00 to your computer and use it in GitHub Desktop.

Select an option

Save jacobsapps/5d6c9df3200fd70b0fbe32cc02713e00 to your computer and use it in GitHub Desktop.
private func makeChunkRequest(sessionId: String, offset: Int64, totalBytes: Int64) -> URLRequest {
var request = URLRequest(url: url("level3/uploads/\(sessionId)/chunk"))
request.httpMethod = "PUT"
request.setValue("application/octet-stream", forHTTPHeaderField: "Content-Type")
request.setValue("\(offset)", forHTTPHeaderField: "Upload-Offset")
request.setValue("\(totalBytes)", forHTTPHeaderField: "Upload-Length")
return request
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment