Skip to content

Commit

Permalink
Merge pull request #167 from SchlenkR/master
Browse files Browse the repository at this point in the history
Refactorings / relaxed URL specification
  • Loading branch information
SchlenkR committed Dec 28, 2023
2 parents 5e60b6c + fb43302 commit 030003c
Show file tree
Hide file tree
Showing 48 changed files with 564 additions and 486 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build-and-publish-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Build and Publish Docs

on:
workflow_dispatch:
push:
branches: [ master ]
# push:
# branches: [ master ]

jobs:
build:
Expand All @@ -16,10 +16,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup .NET 7
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.x
dotnet-version: 8.x

- name: Build solution
run: dotnet build -c Release
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup .NET 6
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.x

- name: Setup .NET 7
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.x
dotnet-version: 8.x

- name: Build and run tests
run: dotnet fsi build.fsx test
9 changes: 2 additions & 7 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,10 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Setup .NET 6
- name: Setup .NET 8
uses: actions/setup-dotnet@v4
with:
dotnet-version: 6.x

- name: Setup .NET 7
uses: actions/setup-dotnet@v4
with:
dotnet-version: 7.x
dotnet-version: 8.x

- name: nuget publish
env:
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
.ionide
symbolCache.db
.paket/load
docs/index.md

# User-specific files
*.suo
Expand Down
14 changes: 11 additions & 3 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<Project>

<PropertyGroup>
<Version>12.2.0-preview02</Version>
<Version>13.2.0</Version>

<Authors>Ronald Schlenker</Authors>
<Copyright>Copyright 2023 Ronald Schlenker</Copyright>
<Copyright>Copyright 2024 Ronald Schlenker</Copyright>
<PackageTags>f# c# fSharp http rest HttpClient fetch curl</PackageTags>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageIcon>logo_small.png</PackageIcon>
<PackageIcon>logo.png</PackageIcon>
<PackageLicenseExpression>Apache-2.0</PackageLicenseExpression>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/fsprojects/FsHttp</RepositoryUrl>
Expand All @@ -16,6 +16,14 @@
<FsDocsReleaseNotesLink>https://www.nuget.org/packages/FsHttp#release-body-tab</FsDocsReleaseNotesLink>

<PackageReleaseNotes>
v13.1.0
- All `Response._TAsync` functions (task based) in F# require a CancellationToken now.

v13.1.0
- There's no more StartingContext, which means:
we give up a little bit of safety here, for the sake of pre-configuring HTTP requests
without specifying the URL. This is a trade-off we are willing to take.

v12.2.0
- added HttpMethods for better composability

Expand Down
10 changes: 0 additions & 10 deletions FsHttp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.32014.148
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{13B4B071-F3F1-4E38-93E4-CFA72611A84F}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FsHttp", "src\FsHttp\FsHttp.fsproj", "{D1AD2123-678B-4DC9-9DBA-3D6FF2E30F61}"
EndProject
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "FsHttp.FSharpData", "src\FsHttp.FSharpData\FsHttp.FSharpData.fsproj", "{07320ED5-9E4A-452E-80C3-007C3303735F}"
Expand Down Expand Up @@ -51,14 +49,6 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{D1AD2123-678B-4DC9-9DBA-3D6FF2E30F61} = {13B4B071-F3F1-4E38-93E4-CFA72611A84F}
{07320ED5-9E4A-452E-80C3-007C3303735F} = {13B4B071-F3F1-4E38-93E4-CFA72611A84F}
{CB577E4F-F4F0-4ADA-BD90-036B5ECF17AD} = {13B4B071-F3F1-4E38-93E4-CFA72611A84F}
{1163EF7E-1845-4D2A-8C3F-8691618500DF} = {13B4B071-F3F1-4E38-93E4-CFA72611A84F}
{E7E326FD-1D66-4DBD-AB60-D006D3B77244} = {13B4B071-F3F1-4E38-93E4-CFA72611A84F}
{63A6AF47-CB3F-4DBA-A16E-B66D6EFA3573} = {13B4B071-F3F1-4E38-93E4-CFA72611A84F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {490D0829-D4E3-4267-8132-14A5B0C9D347}
EndGlobalSection
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<p align="center">
<img src='https://raw.githubusercontent.com/fsprojects/FsHttp/master/docs/img/logo_big.png' alt='logo' width='300' />
<img src='https://raw.githubusercontent.com/fsprojects/FsHttp/master/docs/img/logo.png' alt='logo' width='300' />
</p>

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.
Expand Down Expand Up @@ -41,9 +41,10 @@ An example in C#:
```csharp
#r "nuget: FsHttp"

using FsHttp.CSharp;
using FsHttp;

await "https://reqres.in/api/users".Post()
await "https://reqres.in/api/users"
.Post()
.CacheControl("no-cache")
.Body()
.JsonSerialize(new
Expand All @@ -67,7 +68,7 @@ Release Notes / Migrating to new versions
---

* See https://www.nuget.org/packages/FsHttp#release-body-tab
* For different upgrade paths, please read the [Migrations section](https://fsprojects.github.io/FsHttp/Migrations.html) in the docu.
* For different upgrade paths, please read the [Migrations section](https://schlenkr.github.io/FsHttp/Migrations.html) in the docu.


GitHub
Expand Down Expand Up @@ -101,5 +102,5 @@ For common tasks, there are powershell files located in the repo root:
Credits
-------

* Parts of the code is taken from the [HTTP utilities of FSharp.Data](https://fsprojects.github.io/FSharp.Data/library/Http.html).
* Parts of the code is taken from the [HTTP utilities of FSharp.Data](https://schlenkr.github.io/FSharp.Data/library/Http.html).
* Credits to all critics, supporters, contributors, promoters, users, and friends.
Binary file added artwork/Grayscale Transparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/Original Logo Symbol.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/Original Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added artwork/Transparent Logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion docs/Builders_and_Evaluation.fsx.bak
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ simply build a request, pass it around and send it later or to warp it in async.

Chaining builders together: First, use a httpLazy to create a 'HeaderContext'

*Hint:* ```httpLazy { ... }``` is just a shortcut for ```httpRequest StartingContext { ... }```
*)
let postOnly =
httpLazy {
Expand Down
1 change: 0 additions & 1 deletion docs/Overview.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ open FsHttp
// Reference the 'FsHttp' package from NuGet in your script or project
#r "nuget: FsHttp"

// Opening 'FsHttp' is sufficient (no need for FsHttp.DSL or others anymore).
open FsHttp

(**
Expand Down
2 changes: 1 addition & 1 deletion docs/Response_Handling.fsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ open FsHttp
There are several ways transforming the content of the returned response to
something like text or JSON:
See also: [Response](reference/fshttp-response.html)
See also: [Response](reference/FsHttp-response.html)
*)
http {
POST "https://reqres.in/api/users"
Expand Down
38 changes: 19 additions & 19 deletions docs/content/fsdocs-theme.css
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
:root {
--fshttp-50: #f0fdf2;
--fshttp-100: #dbfde3;
--fshttp-200: #baf8c8;
--fshttp-300: #64ee85;
--fshttp-400: #47e16c;
--fshttp-500: #1ec948;
--fshttp-600: #13a637;
--fshttp-700: #12832e;
--fshttp-800: #14672a;
--fshttp-900: #135425;
--fshttp-950: #042f11;
--FsHttp-50: #f0fdf2;
--FsHttp-100: #dbfde3;
--FsHttp-200: #baf8c8;
--FsHttp-300: #64ee85;
--FsHttp-400: #47e16c;
--FsHttp-500: #1ec948;
--FsHttp-600: #13a637;
--FsHttp-700: #12832e;
--FsHttp-800: #14672a;
--FsHttp-900: #135425;
--FsHttp-950: #042f11;
--logo-background-color: #224454;
--pearl: #FFFDFA;

--primary: var(--fshttp-300);
--primary: var(--FsHttp-300);
--header-background: var(--logo-background-color);
--header-link-color: var(--pearl);
--fsdocs-theme-toggle-light-color: var(--pearl);
--menu-color: var(--pearl);
--blockquote-bacground-color: var(--primary);
--blockquote-color: var(--pearl);
--menu-item-hover-background: var(--fshttp-200);
--menu-item-hover-background: var(--FsHttp-200);
--menu-item-hover-color: var(--logo-background-color);
--on-this-page-color: var(--pearl);
--heading-color: var(--fshttp-950);
--page-menu-background-hover-border-color: var(--fshttp-300);
--nav-item-active-border-color: var(--fshttp-300);
--dialog-icon-color: var(--fshttp-300);
--dialog-link-color: var(--fshttp-300);
--heading-color: var(--FsHttp-950);
--page-menu-background-hover-border-color: var(--FsHttp-300);
--nav-item-active-border-color: var(--FsHttp-300);
--dialog-icon-color: var(--FsHttp-300);
--dialog-link-color: var(--FsHttp-300);
}

[data-theme=dark] {
--link-color: var(--fshttp-200);
--link-color: var(--FsHttp-200);
--heading-color: var(--pearl);
}
Binary file modified docs/img/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/img/logo_big.png
Binary file not shown.
Binary file removed docs/img/logo_small.png
Binary file not shown.
126 changes: 0 additions & 126 deletions docs/index.md

This file was deleted.

2 changes: 1 addition & 1 deletion fiddle/DUShadowingInCEs.fsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#r "../src/FsHttp/bin/debug/net7.0/fshttp.dll"
#r "../src/FsHttp/bin/debug/net7.0/FsHttp.dll"

open System
open FsHttp
Expand Down
2 changes: 1 addition & 1 deletion fiddle/co-maintainer.fsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

#r "../src/FsHttp/bin/debug/net7.0/fshttp.dll"
#r "../src/FsHttp/bin/debug/net7.0/FsHttp.dll"
#r "nuget: FsHttp"

open System
Expand Down
14 changes: 14 additions & 0 deletions fiddle/debugBuildFiddle.fsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

#r "../src/FsHttp/bin/Debug/net8.0/FsHttp.dll"

open FsHttp

let httpWithAuth =
http {
AuthorizationBearer "sdfsdffsdf"
}

httpWithAuth {
GET "https://jsonplaceholder.typicode.com/todos/1"
}
|> Request.send
Loading

0 comments on commit 030003c

Please sign in to comment.