Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.4K
Views
How to send an octet-stream with Axios

I am following the LinkedIn documentations Here to upload a file as an octet stream to the LinkedIn Assets API, but I keep getting back an empty response

This is the curl example they gave

curl -v -H "Content-Type:application/octet-stream" --upload-file /Users/username/SampleVideo_2mb.mp4 'https://api.linkedin.com/mediaUpload/C5400AQHpR1ANqMWqNA/uploadedVideo/0?ca=vector_feedshare&cn=uploads_secure&ccn=ambry-video&m=AQLEZ2pjh43pagYYYXRaCyztOykwDzluHkkYTbsMjNUzivrEOeObw9h3&app=1234&sync=1&v=beta&ut=1KeEm4JnMnJpo1'

What is the proper axios equivalent of the above code?

Here is what I tried in NodeJS

    let uploadHeaders = uploadRegisterData['uploadMechanism']['com.linkedin.digitalmedia.uploading.MediaUploadHttpRequest']['headers'];

    let videoUploadFinaleResponse = await axios.put(uploadUrl, fs.createReadStream(fileName), {
           headers: {
           'Accept': '*/*',
            ...uploadHeaders,
           'Content-Type': 'application/octet-stream'
          }
      });
    let uploadedVideoData = videoUploadFinaleResponse.data; //This is always coming back as an empty string

The response data is always coming back as an empty string "".

I have a feeling my axios code equivalent is somehow wrong.

How can I get this right?

Thank you.

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!