1

This should be simple, but I must be using the wrong key words to find the answer.

How can I output the raw query string that the jsonserviceclient is generating when sending a request to the server? I know I could use fiddler or something else to snoop the answer to this, but I'm interested if there is something like:

  var client = new JsonServiceClient("http://myService:port/");

  var request = new MyOperation
  {
     SomeDate = DateTime.Today
  };

  Console.Out.Writeline(client.AsQueryString(request));

1 Answer 1

1

You can use the Reverse Routing extension methods to see what urls different populated Request DTOs would generate, e.g:

var relativeUrl = new MyOperation { SomeDate = DateTime.Today }.ToGetUrl();
var absoluteUrl = new MyOperation { SomeDate = DateTime.Today }.ToAbsoluteUri();
Sign up to request clarification or add additional context in comments.

2 Comments

Is this only available in ServiceStack 4.0+?
@Bitfiddler I believe they're also available in v3, if you want to ask questions about v3 please use the servicestack-bsd tag.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.