views:

20

answers:

1

Hi there,

It appears the query string parameters you can pass to a rest method in WCF REST is case insesitive - actually this makes sense.

What the best naming convention for parameters with 2 words, using an _ (underscore) ?? I never liked this, i prefered to use camelCasing but if its insensitive what other options to do i have?

for example here is my method's WebGet

  [WebGet(UriTemplate = "?skip={skip}&top={top}&unansweredOnly={unansweredOnly}")]

Notice i have the word unansweredOnly, so i could do this unanswered_only.... or of course i could leave it like unansweredOnly (camelcasing) but of course unansweredonly would also work... but i could show it as UnansweredOnly in the documentation for the service.

Now something surprising is that in the help page of wcf rest service it shows it as camelcasing :-)

  (from help page)  ?skip={skip}&top={top}&unansweredOnly={unansweredOnly}

I suppose i am trying to get an idea what everyone is doing, aand whats the recommended way of doing things.

I would really apprecaite some feedback.

I don't want to get into a bad habit

Thanks in advance

A: 

The http spec says that the query string should be case sensitive.

If WCF is case-insensitive, why would that stop you from using camel casing?

Even if your web framework use case sensitive query strings, you should never use query string parameters that differ only in case.

Darrel Miller
Thanks darrel, explained perfectly as always... thanks again
Martin