Is there any class, library or some piece of code which will help me to upload files with HTTPWebrequest?
Edit 2:
I do not
Not sure if this was posted before but I got this working with WebClient. i read the documentation for the WebClient. A key point they make is
If the BaseAddress property is not an empty string ("") and address does not contain an absolute URI, address must be a relative URI that is combined with BaseAddress to form the absolute URI of the requested data. If the QueryString property is not an empty string, it is appended to address.
So all I did was wc.QueryString.Add("source", generatedImage) to add the different query parameters and somehow it matches the property name with the image I uploaded. Hope it helps
public void postImageToFacebook(string generatedImage, string fbGraphUrl)
{
WebClient wc = new WebClient();
byte[] bytes = System.IO.File.ReadAllBytes(generatedImage);
wc.QueryString.Add("source", generatedImage);
wc.QueryString.Add("message", "helloworld");
wc.UploadFile(fbGraphUrl, generatedImage);
wc.Dispose();
}