Skip to content

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

Description

@snechaev

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

varclient=newRestClient("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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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