Click here to Skip to main content
15,888,984 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
var client = new RestClient("http://example.com");

var request = new RestRequest("resource/{id}", Method.POST);
request.AddParameter("username", txtUsername.Text); // adds to POST or URL querystring based on Method
request.AddParameter("password", txtPassword.Text); // adds to POST or URL querystring based on Method

// execute the request
RestResponse response = client.Execute(request);
var content = response.Content; // raw content as string


This Code Showing Error

Error 1 The type or namespace name 'RestRequest' could not be found (are you missing a using directive or an assembly reference?)

Error 2 The type or namespace name 'RestClient' could not be found (are you missing a using directive or an assembly reference?)
Posted

1 solution

Exactly what the error message states. Add reference to DLL in which these classes exist. Add using statement to import namespaces which contain these classes.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900