Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/odroe/ocookie
🍪 Cookie and Set-Cookie parser and serializer
https://github.com/odroe/ocookie
cookie dart parser serializer set-cookie
Last synced: 10 days ago
JSON representation
🍪 Cookie and Set-Cookie parser and serializer
- Host: GitHub
- URL: https://github.com/odroe/ocookie
- Owner: odroe
- License: mit
- Created: 2020-04-24T15:43:06.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-12-26T13:44:17.000Z (13 days ago)
- Last Synced: 2024-12-26T14:17:17.255Z (13 days ago)
- Topics: cookie, dart, parser, serializer, set-cookie
- Language: Dart
- Homepage: https://pub.dev/packages/ocookie
- Size: 12.7 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# 🍪 Ocookie
Cookie and Set-Cookie parser and serializer.
## Installation
To install `ocookie` add the following to your `pubspec.yaml`
```yaml
dependencies:
ocookie: latest
```Alternatively, you can run the following command:
```bash
dart pub add ocookie
```## Baisc Usage
```dart
final cookie = Cookie('name', 'value');
print(cookie.serialize()) // name=value
print(Cookie.parse('a=b;b=c')); // {a: b, b: c}
```### Utils
- `Cookie.serialize` - Serialize a cookie instance to string.
- `Cookie.parse` - Parse client-side `cookie` header map.
- `Cookie.fromString` - Parse a set-cookie string to Cookie instance.
- `Cookie.splitSetCookie` - Split a string of multiple set-cookie values into a set-cookie string list.# API Reference
See the [API documentation](https://pub.dev/documentation/ocookie) for detailed information about all available APIs.
## License
[MIT License](LICENSE)