SIGN UP MEMBER LOGIN:    
ARTICLE

Three Way to Form URI for REST Services

Posted by Dhananjay Kumar Articles | WCF with C# July 28, 2010
In this article, I will show how we could construct URI in three ways.
Reader Level:
Download Files:
 

Objective 

In this article, I will show how we could construct URI in three ways. 

Method # 1: Creating URI from string 

I am passing string in constructor of URI class, to create new URI. 

1.gif
 
Output

2.gif 

Method #2: New URI from Component Instance 

I am here taking host and path individually and then combining them in constructor of Uri class. 

3.gif
 
Output

4.gif 

Method #3: Creating URI using Try Pattern validation 

In this , I am showing you how could we use Try Pattern method of URI class to construct an URI. 

5.gif
 
Output 
 
6.gif

Login to add your contents and source code to this article
share this article :
post comment
 

hey , can u tell me about uri class ? why is it used and its purpose ?

Posted by Hassan Humayun Jul 31, 2010
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
Become a Sponsor