Coder Social home page Coder Social logo

fshttp's Introduction

FsHttp

FsHttp is a .Net HTTP client library for C# and F#. It aims for describing and executing HTTP requests in convenient ways that can be used in production and interactive environments.

The design principle behind FsHttp is:

Specify common HTTP requests in a most convenient and readable way, while still being able to access the underlying .Net Http representations for covering unusual cases.

FsHttp is developed and maintained by @ronaldschlenker and @dawedawe. Feel free to leave us a message.

NuGet Badge build status

Sponsoring

Want to help keep FsHttp alive? Then help keep F# and its ecosystem alive by supporting one of the following developers:

  • @edgarfgp. Why? E.g. for "Amplifying F#", for bringing people together, for his support and his work in the F# community.
  • @TheAngryByrd. Why? E.g. for maintaining Ionidem and many, many more.
  • @AngelMunoz. Why? E.g. for his work in Fable (The F# to JS compiler), his passion and support.
  • @dawedawe and @nojaf. Why? E.g. for Fantomas and their support in the F# community.
  • @PawelStadnicki. Why? E.g. for his attempt to push F# forward in data science.

For sure, there are many more. If you think someone should appear on that list, leave us a message!

A Simple Example

An example in F#:

#r "nuget: FsHttp"

open FsHttp

http {
    POST "https://reqres.in/api/users"
    CacheControl "no-cache"
    body
    jsonSerialize
        {|
            name = "morpheus"
            job = "leader"
        |}
}
|> Request.send

An example in C#:

#r "nuget: FsHttp"

using FsHttp.CSharp;

await "https://reqres.in/api/users".Post()
    .CacheControl("no-cache")
    .Body()
    .JsonSerialize(new
        {
            name = "morpheus",
            job = "leader"
        }
    )
    .SendAsync();

Documentation

Release Notes / Migrating to new versions

GitHub

Please see FsHttp on GitHub.

Building

.Net SDK:

You need to have the latest .Net SDK installed, which is specified in ./global.json.

Build Tasks

There is a F# build script (./build.fsx) that can be used to perform several build tasks from command line.

For common tasks, there are powershell files located in the repo root:

  • ./test.ps1: Runs all tests (sources in ./src/Tests).
    • You can pass args to this task. E.g. for executing only some tests: ./test.ps1 --filter Name~'Response Decompression'
  • ./docu.ps1: Rebuilds the FsHttp documentation site (sources in ./src/docs; output goes to ./docs).
  • ./docu-watch.ps1: Run it if you are working on the documentation sources, and want to see the result in a browser.
  • ./publish.ps1: Publishes all packages (FsHttp and it's integration packages for Newtonsoft and FSharp.Data) to NuGet.
    • Always have a look at ./src/Directory.Build.props and keep the file up-to-date.

Credits

  • Parts of the code is taken from the HTTP utilities of FSharp.Data.
  • Credits to all critics, supporters, contributors, promoters, users, and friends.

fshttp's People

Contributors

schlenkr avatar dawedawe avatar tnishimura avatar mefgalm avatar samuel-dufour avatar b0wter avatar davejohnson8080 avatar vilinski avatar captncodr avatar saerosv avatar maciej-izak avatar maxdeg avatar michaeloyer avatar drhumlen avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.