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: about 2 months 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 7 years ago)
- Default Branch: master
- Last Pushed: 2019-07-19T06:20:47.000Z (almost 6 years ago)
- Last Synced: 2025-04-01T18:50:12.968Z (3 months ago)
- Topics: cookie-drive, cookie-file, cookiejar, cookiejar-file, drive, go, netscape-cookies
- Language: Go
- Homepage:
- Size: 18.6 KB
- Stars: 5
- Watchers: 1
- Forks: 6
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## CookieJar
A cookiejar drive with Go.[](https://996.icu)
[-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))
}
```