/CookiesText

Primary LanguageSwiftMIT LicenseMIT

CookiesText badge-platforms badge-languages badge-release badge-license

It loads array of HTTPCookie from cookies.txt

Example

import CookiesText

// load from cookies.txt
let cookies = try CookiesText.cookies(of: cookiesTxtURL)
for cookie in cookies {
    HTTPCookiesStorage.shared.setCookie(cookie)
}

// shorthands
try HTTPCookiesStorage.shared.setCookies(from: cookiesTxtURL)

Installation

package.append(
    .package(url: "https://github.com/griffin-stewie/CookiesText.git", from: "0.1.0")
)

package.targets.append(
    .target(name: "Foo", dependencies: [
        .product(name: "CookiesText", package: "CookiesText")
    ])
)

Inspirations