TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mario SAg
NA
1
1.1k
i! I got a problem make the curl command equivalent to my C#
May 23 2016 5:31 AM
$ curl
-X POST
-H
"Authorization: Bearer YOUR_ACCESS_TOKEN"
-F
"recipients[0][name]=John"
-F
"recipients[0][email]
[email protected]
"
-F
"files[0]=@/path/to/the/pdf/document.pdf"
https:
//api.sandbox.signaturit.com/v3/signatures.json
i made this code in c#
using
System;
using
System.IO;
using
System.Net;
using
System.Text;
using
System.Web;
public
class
Program
{
public
static
void
Main()
{
string response = SendSignatureRequest(
"ZDM4NzU1YTVmNmFhNGMwMGQ3MTdiOTBhNmNiZDQzOTlkYjg4OTk0MTg5MGM3OGFlZjk1OWM1ZDg1NTQxYzBjYQ"
,
"Mario"
,
"
[email protected]
"
,
//"http://www.analysis.im/uploads/seminar/pdf-sample.pdf"
"@c://Mariete.pdf"
);
Console.WriteLine(response);
}
public
static
string SendSignatureRequest(string apiKey, string name, string email, string file)
{
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(
"https://api.sandbox.signaturit.com/v3/signatures.json"
);
request.Method =
"POST"
;
string authorization = apiKey;
request.Headers.Add(
"Authorization"
,
"Bearer "
+ authorization);
var postData =
"recipients[0][name]="
+ name;
postData +=
"&recipients[0][email]="
+ email;
postData +=
"&files[0]="
+ file;
var data = Encoding.ASCII.GetBytes(postData);
request.ContentType =
"application/json"
;
request.ContentLength = data.Length;
using
(var stream = request.GetRequestStream())
{
stream.Write(data, 0, data.Length);
}
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
return
new
StreamReader(response.GetResponseStream()).ReadToEnd();
}
}
Reply
Answers (
0
)
Regarding Whatsapp API registration
how to get datetime with nanoseconds in c# asp.net