Note that there are some explanatory texts on larger screens.

plurals
  1. POServiceStack request hit service twice
    primarykey
    data
    text
    <p>I have a simple service like this:</p> <pre><code>[Route("/Message/{Folder}", "GET")] public class MessageList : IReturn&lt;List&lt;Message&gt;&gt; { public string Folder { get; set; } } public class MessageListService : Service { private readonly IDatabase _database; public MessageListService(IDatabase database) { _database = database; } public List&lt;Message&gt; Get(MessageList request) { return _database.Fetch&lt;Message&gt;( "EXEC GetMessage @@Folder=@1", request.Folder); } </code></pre> <p>I call it like this:</p> <pre><code> http://localhost/Message/Inbox </code></pre> <p>Somehow, the service got hit twice: first the right request, then again with request.Folder undefined. The strange thing is, even the second call doesn't return any data, the framework always return the correct result from the first call. So I never noticed this until happened to run a SQL profiler. </p> <p>I couldn't figure out exactly what causes the retry. I thought it might be data related because if I call Inbox through my razor UI, it doesn't repeat. If I call Archive, then it does. But if I call with random parameter like XYZ that returns no data, it also repeat the call.</p> <p>However, if I call the service like this:</p> <pre><code> http://localhost/Message/Inbox?format=json </code></pre> <p>then it always hit service twice, one valid and one without input parameter. But the Json result seems always correct. The second invalid call just hit database then disappeared.</p> <p>Really need some help. Any idea what's going on?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload