The following example shows how to create a file attachment to a list item:
url: http://site url/_api/web/lists/getbytitle('list title')/items(item id)/AttachmentFiles/ add(FileName='file name')
method: POST
headers:
Authorization: "Bearer " + accessToken
body: "Contents of file."
X-RequestDigest: form digest value
content-length:length of post body
C# example
var fileName = System.IO.Path.GetFileName(filePath);
var endpointUrl = string.Format("{0}/_api/web/lists/GetByTitle('{1}')/items({2})/AttachmentFiles/add(FileName='{3}')",webUri,listTitle,itemId,fileName);
HttpClient client = new HttpClient(handler);
client.DefaultRequestHeaders.Add("X-RequestDigest", formDigest);
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", accessToken);
using (var stream = System.IO.File.OpenRead(filePath))
{
var response = client.PostAsync(endpointUrl, new StreamContent(stream)).Result;
}
References
Working with files attached to list items by using REST