I have PHP code like below and I want to write a function which makes the same job in C#. However, I didn't understand what curl_setotp does, exactly. How can I write a function like that?
public static function sendDataAuth( $url, $doc,$authData) {
$ch = curl_init($url );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $doc);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch,CURLOPT_HTTPHEADER,array('OpenPayu-Signature:'.$authData));
$response = curl_exec($ch);
return $response;
}
GETrequests, so curlopt_post=>true changes it to use aPOSTinstead.CURLOPT_HTTPHEADERis just a header to send andCURLOPT_POSTFIELDSis data to send.