Skip to content

Instantly share code, notes, and snippets.

View ccondry's full-sized avatar

Coty Condry ccondry

  • Cisco Systems
  • Texas
View GitHub Profile
@ccondry
ccondry / submit.md
Created February 22, 2021 21:33 — forked from tanaikech/submit.md
Multipart-POST Request Using Node.js

Multipart-POST Request Using Node.js

Here, I introduce 2 scripts for uploading files to Slack using Node.js as samples. These 2 sample scripts are for uploading files to Slack.

Sample script 1:

  • You can upload the zip file by converting byte array as follows.
    • At first, it builds form-data.
    • Adds the zip file converted to byte array and boundary using Buffer.concat().
    • This is used as body in request.