Class
HttpRequestHandler
class HttpRequestHandler: NSObject
handle http request related (e.g. upload, verify)
Relationships
Conforms To
NSObject
URLSessionTaskDelegate
Initializers
init(delegate:)
init(delegate: HttpRequestHandlerDelegate)
Properties
httpRequestHandlerDelegate
let httpRequestHandlerDelegate: HttpRequestHandlerDelegate!
Methods
upload(toUpload:)
func upload(toUpload url: URL)
uploadOneFile(url:)
func uploadOneFile(url: URL)
uploadAllFilesOneByOne(fileUrls:)
func uploadAllFilesOneByOne(fileUrls: [URL])
under current setup, the "upload" button on the library view is essentially calling this function. This function uploads files specified by fileUrls from small to large recursively. A verify request is sent after each upload request complete
urlSession(_:didBecomeInvalidWithError:)
func urlSession(_ session: URLSession, didBecomeInvalidWithError error: Error?)
print error message to console when the session become invalid due to an error
urlSessionDidFinishEvents(forBackgroundURLSession:)
func urlSessionDidFinishEvents(forBackgroundURLSession session: URLSession)
urlSession(_:task:didCompleteWithError:)
func urlSession(_ session: URLSession, task: URLSessionTask, didCompleteWithError error: Error?)
urlSession(_:task:didSendBodyData:totalBytesSent:totalBytesExpectedToSend:)
func urlSession(_ session: URLSession, task: URLSessionTask, didSendBodyData bytesSent: Int64, totalBytesSent: Int64, totalBytesExpectedToSend: Int64)
calculate upload progress for the file