User-1852975005 posted
Hi, I have the below code;
I am new to this and I dont now if I am going about this in the right way at all.
The line -
Client.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors) =>
true;
Gives the below error.
Severity
|
Code
|
Description
|
Project
|
File
|
Line
|
Suppression State
|
Error
|
CS0136
|
A local or parameter named 'sender' cannot be declared in this scope because that name is used in an enclosing local scope to define a local or parameter
|
restClient_0
|
C:\Users\Administrator\Desktop\VP-O\VP-0-REST-Client-master\VP-0-REST-Client-master\restClient_0\Form1.cs
|
27
|
Active
|
A dum question what is Sender and what is it asking for?
private
void cmdGO_Click(object
sender, EventArgs e)
{
var Client =
new RestClient("https://xx.xx.xx.xx.:8443/xxxx/xxxxxx/work/");
Client.RemoteCertificateValidationCallback = (sender, certificate, chain, sslPolicyErrors)
=> true;
var request =
new RestRequest();
request.AddHeader("authorization",
"Basic xxxxxxxxxxxxxxxxxx");
//Execute Request
IRestResponse response = Client.Execute(request);
txtResponse.Text = response.Content;
}
Thanks,