Confluence Cloud API Documentation - "Content - attachments" examples are incomplete

I must prefix this post and explain that I am very new to writing scripts and working with APIs.
I am looking at the URL below and believe that the example is incorrect.

I am trying to work out how to attach a file to confluence using Node JS. The multiple language guide on the right gives an example of the post request in Node Js, but I believe that it is incorrect as the post request has no body defined.

Am I correct and the examples in the different languages need updating, or is there something fundamental that I do not understand?

Thanks Steve