Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/telanflow/cookiejar
A cookiejar drive with Go (Netscape HTTP cookie file)
https://github.com/telanflow/cookiejar
cookie-drive cookie-file cookiejar cookiejar-file drive go netscape-cookies
Last synced: 2 days ago
JSON representation
A cookiejar drive with Go (Netscape HTTP cookie file)
- Host: GitHub
- URL: https://github.com/telanflow/cookiejar
- Owner: telanflow
- License: apache-2.0
- Created: 2018-03-19T13:50:19.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-19T06:20:47.000Z (over 5 years ago)
- Last Synced: 2024-06-20T12:39:19.727Z (5 months ago)
- Topics: cookie-drive, cookie-file, cookiejar, cookiejar-file, drive, go, netscape-cookies
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 5
- Watchers: 2
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## CookieJar
A cookiejar drive with Go.[![996.icu](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu)
[![LICENSE](https://img.shields.io/badge/license-NPL%20(The%20996%20Prohibited%20License)-blue.svg)](https://github.com/996icu/996.ICU/blob/master/LICENSE)## Example
```go
package mainimport (
"fmt"
"net/http"
"io/ioutil"
"github.com/telanflow/cookiejar"
)func main() {
// Netscape HTTP Cookie File
jar, _ = cookiejar.NewFileJar("cookie.txt", nil)client := &http.Client{
Jar: jar,
}req, _ := http.NewRequest(http.MethodGet, "https://telan.me", nil)
resp, err := client.Do(req)
if err != nil {
fmt.Println(err.Error())
return
}
defer resp.Body.Close()c, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(c))
}
```