ADD_ATTACHMENT with XML or json

ADD_ATTACHMENT with XML or json

I would like to add an attachement to a ticket using xml or json but I have not found much info online besides people using C# or python. I tried doing:
http://somesite/xxxx/request?OPERATION_NAME=ADD_ATTACHMENT&format=XML&TECHNICIAN_KEY=xxxx-xxxx-xx...&INPUT_DATA= C:\users\...\...filename.txt 

but I keep getting the error:
 Error when adding attachmentthe request doesn't contain a multipart/form-data or multipart/mixed stream, content type header is nul

Does anyone have any suggestions?