title: Uploading an attachment to Azure DevOps Server using Rest API from a JavaScript application
body: <p>I'm looking for an example on how to generate the request body when uploading an attachment to Azure DevOps Server. Looking at the documentation <a href="https://docs.microsoft.com/en-us/rest/api/azure/devops/wit/attachments/create?view=azure-devops-server-rest-5.0#upload-a-binary-file" rel="nofollow noreferrer">here</a>, it notes the content for the body should be &quot;[BINARY FILE CONTENT]&quot;. The content of the body is coming from a URL (https://someURL/images/abc.png for example). How do I get from fetch(url) -&gt; binary content to put in the POST request to create the attachment?</p>