TextResponse.swift 444 B

1234567891011121314151617
  1. //
  2. // TextResponse.swift
  3. // Swifter
  4. //
  5. // Created by Dawid Szymczak on 15/08/16.
  6. // Copyright © 2016 Damian Kołakowski. All rights reserved.
  7. //
  8. import Foundation
  9. public class TextResponse: Response {
  10. public override func content() -> (contentLength: Int, contentString: String) {
  11. let contentString = String(self.contentObject)
  12. let data = [UInt8](contentString.utf8)
  13. return (data.count, contentString)
  14. }
  15. }