Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancellable request doc seems to be wrong #84

Closed
mohan-murali opened this issue Dec 20, 2021 · 1 comment
Closed

Cancellable request doc seems to be wrong #84

mohan-murali opened this issue Dec 20, 2021 · 1 comment

Comments

@mohan-murali
Copy link

Hi,

I don't think the docs for cancellable request of service stack is correct. I am trying to implement the same and I am finding things missing.

Link - https://docs.servicestack.net/cancellable-requests

So the issues I found are

  • Guid generation method is not correct. If I copy the below code into doc, I get error
var tag = Guid.NewGuid().ToString();
  • JsonServiceClient does not seem have a method that exposes the request object, to set the Xtag in header.

Kindly look through the docs. Thanks

@mythz
Copy link
Member

mythz commented Dec 20, 2021

The docs are accurate, as the code example compiles without issue:

var baseUri = "https://example.org";
var tag = Guid.NewGuid().ToString();
var client = new JsonServiceClient(baseUri) {
    RequestFilter = req => req.Headers[HttpHeaders.XTag] = tag
};

Your project must have issues, Guid.NewGuid() is a core Type built into the .NET BCL.

@mythz mythz closed this as completed Dec 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants