Skip to content

[Docs] Simple factory docs sample can not be compiled #2255

Closed
@snechaev

Description

@snechaev

Describe the bug
Docs link: https://restsharp.dev/docs/usage/client#simple-factory
Src link:

var client = new RestClient("https://api.twitter.com/2", true);

The code from the docs var client = new RestClient("https://api.twitter.com/2", true); can not be compiled because there is no appropriate constructor for this parameters set.

To Reproduce
Copy code from the docs (var client = new RestClient("https://api.twitter.com/2", true);), try to compile.

Expected behavior
The code compiles without errors.

Stack trace
No stack trace, build error.
Error CS1503 : Argument 2: cannot convert from "bool" to "RestSharp.ConfigureHeaders?".

Desktop (please complete the following information):

  • OS: macos 14.6.1
  • .NET version: net8
  • Version 111.4.1

Additional context
There are several constructor overloads with the useClientFactory parameter, but I can't say for sure which is the best one to show as an example in the docs.

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