Add login/logout support

This commit is contained in:
Anh Do
2020-03-09 20:19:24 -04:00
parent 8f5f856e49
commit 034aabbfff
9 changed files with 298 additions and 14 deletions

View File

@@ -33,7 +33,12 @@ public extension URLRequest {
])
case .feedWranglerToken:
self.url = url.appendingQueryItem(URLQueryItem(name: "access_token", value: credentials.secret))
case .readerBasic:
case .newsBlur:
setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
httpMethod = "POST"
let postData = "username=\(credentials.username)&password=\(credentials.secret)"
httpBody = postData.data(using: String.Encoding.utf8)
case .readerBasic:
setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
httpMethod = "POST"
var postData = URLComponents()