Type '{' '}' in url

I would like to type brace symbol inside a URL using the url or hyperref package. Is there a way to do that ?

(the idea is to typeset REST-like URL, as for example,

http://foo.bar/orders{orderID}
-

Just type the URL:

\documentclass{article}
\usepackage{url}
\begin{document}
\url{http://foo.bar/orders{orderID}}
\end{document}

With hyperref it's the same, but the result is an invalid URL, I guess.

-
hum ... I am confused .. I spent one hour trying to solve a non-existent problem. Thanks egreg. –  jean Feb 25 '14 at 10:06
@jean In general, though, adding a backslash before the brace will escape it and allow you to display a curly brace on screen, e.g., \{Hello\}. –  Dennis Feb 25 '14 at 18:08

With hyperref, for fun (egreg was tooooo fast with url ;)...)

\documentclass{article}
\usepackage{hyperref}
\begin{document}
\href{http://foo.bar/orders{orderID}}{\texttt{http://foo.bar/orders\{orderID\}}}
\end{document}

-
Or \url{http://foo.bar/orders{orderID}}, no need for \href here. –  Heiko Oberdiek Feb 25 '14 at 13:45
@HeikoOberdiek: Correct, but you know egreg was faster than me in typing. Hence I thought of alternative. :) –  Harish Kumar Feb 25 '14 at 13:56