Bitfiddler
Bitfiddler

Reputation: 4202

ServiceStack Raw Client query string

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));

Upvotes: 1

Views: 107

Answers (1)

mythz
mythz

Reputation: 143284

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();

Upvotes: 1

Related Questions