All Projects â†’ cake-contrib â†’ Cake.Curl

cake-contrib / Cake.Curl

Licence: MIT License
🍰↕ī¸ A cross-platform add-in for Cake that allows to transfer files to and from remote URLs using curl.

Programming Languages

C#
18002 projects
powershell
5483 projects
shell
77523 projects

Projects that are alternatives of or similar to Cake.Curl

Lyndacoursesdownloader
Cross platform .net core program to download lynda.com courses for offline use
Stars: ✭ 37 (+117.65%)
Mutual labels:  curl, netcore
ddd-net-ef-core
Self study: DDD, .net core, entity framework core
Stars: ✭ 41 (+141.18%)
Mutual labels:  netcore, cake-build
Cake.Incubator
This project contains various experimental but useful extension methods and aliases for Cake
Stars: ✭ 17 (+0%)
Mutual labels:  cake, cake-build
Cake
🍰 Cake (C# Make) is a cross platform build automation system.
Stars: ✭ 3,154 (+18452.94%)
Mutual labels:  cake, cake-build
Cake.Squirrel
Cake Addin to support Squirrel.Windows
Stars: ✭ 12 (-29.41%)
Mutual labels:  cake, cake-build
Cake.Xamarin
🍰 🧩 📱 Cake addin for building Xamarin apps
Stars: ✭ 22 (+29.41%)
Mutual labels:  cake, cake-build
Cake.Electron.Net
A Cake AddIn that extends Cake with Electron.NET command tools.
Stars: ✭ 17 (+0%)
Mutual labels:  cake, cake-build
EPPlus4PHP
an easy-to-use excel library for php project which is compiled with peachpie. NOT FOR THE COMMON PHP PROJECT!
Stars: ✭ 15 (-11.76%)
Mutual labels:  netcore
diciotto
✈ī¸ A no-nonsense PHP Http client focused on DX (PSR 18 compliant)
Stars: ✭ 23 (+35.29%)
Mutual labels:  curl
onvif-discovery
C# .NetStandard 2.0 library to discover ONVIF compliant devices
Stars: ✭ 29 (+70.59%)
Mutual labels:  netcore
nycurl
A web server that fetches data from the New York Times and formats it for display in the terminal.
Stars: ✭ 27 (+58.82%)
Mutual labels:  curl
AspNetCore.Identity.RavenDb
RavenDB user/role persistent store for ASP.NET Core identity provider
Stars: ✭ 17 (+0%)
Mutual labels:  netcore
yab
Call and benchmark YARPC services from the command line.
Stars: ✭ 66 (+288.24%)
Mutual labels:  curl
SimCaptcha
✅ 一ä¸ĒįŽ€å•æ˜“į”¨įš„į‚šč§ĻéĒŒč¯į  (前įĢ¯+后įĢ¯)
Stars: ✭ 49 (+188.24%)
Mutual labels:  netcore
Coding-Standards
Coding Guidelines for C#
Stars: ✭ 125 (+635.29%)
Mutual labels:  netcore
ModernWpf
Modern styles and controls for your WPF applications without need WinRT
Stars: ✭ 65 (+282.35%)
Mutual labels:  netcore
Mediator
Small .NET library that helps with the implementation of mediator pattern for commands, events and queries
Stars: ✭ 31 (+82.35%)
Mutual labels:  netcore
awesome-dotnet-async
A curated list of awesome articles and resources to learning and practicing about async, threading, and channels in .Net platform. 😉
Stars: ✭ 84 (+394.12%)
Mutual labels:  netcore
cake-build
Demonstrates a basic build of a .NET NuGet package using https://cakebuild.net/
Stars: ✭ 22 (+29.41%)
Mutual labels:  cake
H.NotifyIcon.WPF
NotifyIcon for .Net Core 3.1 and .Net 5 WPF.
Stars: ✭ 44 (+158.82%)
Mutual labels:  netcore

Cake.Curl

NuGet NuGet Downloads AppVeyor Travis CI Tests Coverage

Cake.Curl is a cross-platform add-in for Cake that allows to transfer files to and from remote URLs using curl.

Cross-platform

Cake.Curl targets the .NET Standard 2.0 and the .NET Framework 4.6. As such, it will run on Linux, macOS and Windows.

Prerequisites

In order to use Cake.Curl, you will need to have a copy of the curl executable for your OS. It doesn't have to be in a specific location; as long as it's included in your PATH environment variable, Cake will find it.

Usage

The purpose of this add-in is to expose the functionality of curl to the Cake DSL by being a very thin wrapper around its command line interface; this means that you can use Cake.Curl in the same way as you would normally use curl, only with a different interface.

Here are a few examples of how some common usage scenarios would look like in a Cake script.

First of all, you need to import Cake.Curl in your build script by using the add-in directive:

#addin Cake.Curl

Downloading Files

Downloading a text file from a remote HTTP server onto the working directory:

Task("Download")
    .Does(() =>
{
    CurlDownloadFile(new Uri("http://host/file.txt"));
});

Downloading a sequence of text files numbered between 1 and 10 from a remote HTTP server onto the working directory:

Task("Download")
    .Does(() =>
{
    CurlDownloadFile(new Uri("http://host/file[1-10].txt"));
});

Downloading a text file from a remote HTTP server onto the working directory and giving it a different name:

Task("Download")
    .Does(() =>
{
    CurlDownloadFile(
        new Uri("http://host/file.txt"),
        new CurlDownloadSettings
        {
            OutputPaths = new FilePath[] { "renamed.txt" }
        });
});

Downloading multiple files concurrently from different servers onto the working directory:

Task("Download")
    .Does(() =>
{
    CurlDownloadFiles(new[]
    {
        new Uri("ftp://host/file.txt"),
        new Uri("ftp://anotherhost/anotherfile.txt"),
        new Uri("http://yetanotherhost/yetanotherfile.txt")
    }
});

Downloading multiple files into specific paths:

Task("Download")
    .Does(() =>
{
    CurlDownloadFiles(
        new[]
        {
            new Uri("ftp://host/file.txt"),
            new Uri("http://anotherhost/anotherfile.txt"),
        }
        new CurlDownloadSettings
        {
            OutputPaths = new FilePath[]
            {
                "some/path/file.txt",
                "some/other/path/anotherfile.txt"
            }
        });
});

Uploading Files

Uploading a local text file to a remote HTTP server:

Task("Upload")
    .Does(() =>
{
    CurlUploadFile("some/file.txt", new Uri("http://host/path"));
});

Uploading a local text file to a remote FTPS server using credentials:

Task("Upload")
    .Does(() =>
{
    CurlUploadFile(
        "some/file.txt",
        new Uri("ftps://host/path"),
        new CurlSettings
        {
            Username = "username",
            Password = "password"
        });
});

Custom HTTP Headers

Transferring a file using a custom HTTP header in the request:

Task("Upload")
    .Does(() =>
{
    CurlUploadFile(
        "some/file.txt",
        new Uri("http://host/path"),
        new CurlSettings
        {
            Headers = new Dictionary<string, string>
            {
                ["X-SomeHeader"] = "SomeValue"
            }
        });
});

Additional Resources

You can find more information about how to use Cake.Curl in the official documentation for these projects:

You can also see Cake.Curl in action in the following videos:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].