{"id":16485500,"url":"https://github.com/zaid-ajaj/fable.simplehttp","last_synced_at":"2026-03-05T10:32:20.703Z","repository":{"id":33707421,"uuid":"155475916","full_name":"Zaid-Ajaj/Fable.SimpleHttp","owner":"Zaid-Ajaj","description":"Http with Fable, made simple.","archived":false,"fork":false,"pushed_at":"2023-11-01T11:42:17.000Z","size":17590,"stargazers_count":90,"open_issues_count":2,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-27T12:14:39.444Z","etag":null,"topics":["ajax","fable","fsharp","http","request"],"latest_commit_sha":null,"homepage":null,"language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Zaid-Ajaj.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-31T00:44:00.000Z","updated_at":"2024-11-11T18:49:49.000Z","dependencies_parsed_at":"2023-01-15T02:15:24.443Z","dependency_job_id":null,"html_url":"https://github.com/Zaid-Ajaj/Fable.SimpleHttp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zaid-Ajaj%2FFable.SimpleHttp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zaid-Ajaj%2FFable.SimpleHttp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zaid-Ajaj%2FFable.SimpleHttp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Zaid-Ajaj%2FFable.SimpleHttp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Zaid-Ajaj","download_url":"https://codeload.github.com/Zaid-Ajaj/Fable.SimpleHttp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826783,"owners_count":20354220,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ajax","fable","fsharp","http","request"],"created_at":"2024-10-11T13:26:06.502Z","updated_at":"2026-03-05T10:32:19.081Z","avatar_url":"https://github.com/Zaid-Ajaj.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fable.SimpleHttp [![Build Status](https://travis-ci.org/Zaid-Ajaj/Fable.SimpleHttp.svg?branch=master)](https://travis-ci.org/Zaid-Ajaj/Fable.SimpleHttp) [![Build status](https://ci.appveyor.com/api/projects/status/fgbd40ahcyrec5uw?svg=true)](https://ci.appveyor.com/project/Zaid-Ajaj/fable-simplehttp) [![Nuget](https://img.shields.io/nuget/v/Fable.SimpleHttp.svg?maxAge=0\u0026colorB=brightgreen)](https://www.nuget.org/packages/Fable.SimpleHttp)\n\nA library for easily working with Http in Fable projects.\n\n### Features\n\n - Extremely simple API for working with HTTP requests and responses.\n - Implemented in idiomatic F# Async (instead of promises which follow JS semantics)\n - Supports sending and receiving raw binary data (i.e.`Blob` in the browser)\n - Built on top of `XMLHttpRequest` available in all browsers (even IE11!) so it doesn't need the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) nor it's associated polyfill.\n\n### Installation\nInstall from nuget using paket\n```sh\npaket add nuget Fable.SimpleHttp --project path/to/YourProject.fsproj\n```\n\n## Usage\n```fs\nopen Fable.SimpleHttp\n\n// Functions from the Http module are all safe and do not throw exceptions\n\n// GET request\n\nasync {\n    let! (statusCode, responseText) = Http.get \"/api/data\"\n\n    match statusCode with\n    | 200 -\u003e printfn \"Everything is fine =\u003e %s\" responseText\n    | _ -\u003e printfn \"Status %d =\u003e %s\" statusCode responseText\n}\n\n// POST request\n\nasync {\n    let requestData = \"{ \\\"id\\\": 1 }\"\n    let! (statusCode, responseText) = Http.post \"/api/echo\" requestData\n    printfn \"Server responded =\u003e %s\" responseText\n}\n\n// Fully configurable request\nasync {\n    let! response =\n        Http.request \"/api/data\"\n        |\u003e Http.method POST\n        |\u003e Http.content (BodyContent.Text \"{ }\")\n        |\u003e Http.header (Headers.contentType \"application/json\")\n        |\u003e Http.header (Headers.authorization \"Bearer \u003ctoken\u003e\")\n        |\u003e Http.send\n\n    printfn \"Status: %d\" response.statusCode\n    printfn \"Content: %s\" response.responseText\n\n    // response headers are lower cased\n    response.responseHeaders\n    |\u003e Map.tryFind \"content-length\"\n    |\u003e Option.map int\n    |\u003e Option.iter (printfn \"Content length: %d\")\n}\n\n\n// Sending form data\nasync {\n    let formData =\n        FormData.create()\n        |\u003e FormData.append \"firstName\" \"Zaid\"\n        |\u003e FormData.append \"lastName\" \"Ajaj\"\n\n    let! response =\n        Http.request \"/api/echo-form\"\n        |\u003e Http.method POST\n        |\u003e Http.content (BodyContent.Form formData)\n        |\u003e Http.send\n\n    printfn \"Status =\u003e %d\" response.statusCode\n}\n\n\n// Send and receive binary data with Blobs\n// use FileReader module\nasync {\n    let blob = Blob.fromText \"input data\"\n\n    let! response =\n       Http.request \"/api/echoBinary\"\n       |\u003e Http.method POST\n       |\u003e Http.content (BodyContent.Binary blob)\n       |\u003e Http.overrideResponseType ResponseTypes.Blob\n       |\u003e Http.send\n\n    match response.content with\n    | ResponseContent.Blob content -\u003e\n        let! blobContent = FileReader.readBlobAsText content\n        printfn \"Received content: %s\" blobContent // \"Received content: input data\"\n\n    | _ -\u003e\n        printfn \"Unexpected response content\"\n}\n```\n\n## Building and running tests\nRequirements\n\n - Dotnet core 2.1+\n - Mono 5.0+\n - Node 10.0+\n\n\nWatch mode: both client and server live\n```sh\n./build.sh Start\n```\nRunning the the end-to-end tests\n```sh\n./build.sh Test\n```\nor just `Ctrl + Shift + B` to run the cli tests as a VS Code task\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaid-ajaj%2Ffable.simplehttp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaid-ajaj%2Ffable.simplehttp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaid-ajaj%2Ffable.simplehttp/lists"}