I'd like to ask experts.
Dose anyone know how to attach a attachment file to a list item using REST API in SharePoint 2013 ? I searched the bellow document. But there is no information about upload a file as list item's attachments.
http://msdn.microsoft.com/en-us/library/fp142386.aspx
Additional info:
I found the bellow article.
http://chuvash.eu/2013/02/20/rest-api-add-a-plain-text-file-as-an-attachment-to-a-list-item/
According to the article, it's enable to upload a attachment file to a list item using bellow Javascript code. I'd like to use C#. I'm trying now, but I still didn't success.
var content = "Hello, this text is inside the file created with REST API";
var digest = $("#__REQUESTDIGEST").val();
var composedUrl = "/_api/web/lists/GetByTitle('List1')/items(1)/AttachmentFiles/add(FileName='readme.txt')";
$.ajax({
url: composedUrl,
type: "POST",
data: content,
headers: {
"X-RequestDigest": digest
}
})