UrlEncode for Revit Server API calls

The Revit Server SDK contains a Viewer app with the following code:

WebRequest request =
http://” +
tbxServerName.Text +
supportedVersions[cbxVersion.SelectedIndex, 1] +

Better would be to precede that creation of the WebRequest with this line to properly handle any special characters that might be in the path:

info = System.Web.HttpUtility.UrlEncode(info);


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s