Skip to content

Allow full URL's, not only hostnames #41

@derwasp

Description

@derwasp

Description

It is not possible to specify the full URL (e.g. http://my.awesome.api/) as a parameter.
The reason I need this is because I want to be able to specify both http and https endpoints whenever I want to.

Consider the following code:

[<Literal>]
let private awesomeJsonPath = __SOURCE_DIRECTORY__ + "/awesome.swagger.json"
type AwesomeApi = SwaggerProvider<awesomeJsonPath, "Content-Type=application/json">

let private client = new AwesomeApi("http://my.awesome.api/")

printfn "%A" client.AwesomeValueGet(42)

Currently this will crash.

Expected behavior

http/https prefixes are respected and taken into account when the request is constructed

Actual behavior

An unhandled exception of type 'System.Net.WebException' occurred in FSharp.Core.dll
Additional information: The remote name could not be resolved: 'http'

Known workarounds

Use only hostname

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions