tags:

views:

28

answers:

1

I run an OData API. To control usage, an apikey affixed as an url parameter is required (I use a variation of this answer). I'd love for my users to be able to explore the data exposed by the API using LINQPad. Ufortunately, there's no way to tell LINQPad to stick the apikey parameter to the end of query urls.

Are there any good suggestions for how to resolve this (and I'd really like to keep the apikey system).

+1  A: 

If the api key were passed in the headers, you could do this:

SendingRequest += (sender, args) => args.RequestHeaders.Add ("apikey", "foo");

Customers.Take(10).Dump();

However, this won't have an effect when LINQPad fetches metadata. It also won't help you if you need to append the api key to the query string (which seems to be what you want).

Joe Albahari