Skip to content

kaktusakCZ/CookiesTxtParser

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Cookies.txt Parser for .NET

Introduction

A simple library for parsing cookies.txt files, Netscape HTTP Cookie File format used by tools like curl and wget, into:

  • System.Net.CookieCollection for use by HttpClient
  • IReadOnlyList<Cookie> for inspection (since it's difficult to enumerate a CookieCollection)

Installation

The package is available at NuGet:

dotnet add package CookiesTxtParser

Usage

Parse a file by path:

// To CookieCollection
CookiesTxt.Parser.ParseFileAsCookieCollection("/path/to/cookies.txt");

// To IReadOnlyList
CookiesTxt.Parser.ParseFileAsCookies("/path/to/cookies.txt");

Parse a stream:

// To CookieCollection
CookiesTxt.Parser.ParseStreamAsCookieCollection(stream);

// To IReadOnlyList
CookiesTxt.Parser.ParseStreamAsCookies(stream);

About

A cookies.txt parser library for .NET Standard

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%