I am trying to use sendgrid's web API. To use it, you do a get request to a URL that looks like this
sendgrid.com/api/mail.send.json?to=example%40exaple.com&from=example%40example&subject=Subject&text=Body&files=files%5Bfile1.doc%5D%3Dexample.doc%26files%5Bfile2.pdf%5D%3Dexample.pdf&api_user=usnermae&api_key=apikey
What confuses me is the files part:
&files=files%5Bfile1.doc%5D%3Dexample.doc%26files%5Bfile2.pdf%5D%3Dexample.pdf&api_user=usnermae&api_key=apikey
In c# code, how would I give a file that I have in a stream or byte[] to a url?
This is how I am performing the request in the end.
using (WebClient client = new WebClient())
{
string text = client.DownloadString(url);
}
This so far works fine, and I have everything programed in except for the attachments. Can anyone point me in the right direction for how to get files into the URL for a get request?