To make a HTTP request with a custom body as binary in Ruby, you can use the Net::HTTP module that comes with the standard library. Here's an example of how to make a POST request with a binary body:
main.rb411 chars15 lines
In this example, we create a POST request with the Net::HTTP::Post.new method, set the binary body and set the content_type to 'application/octet-stream'. Then, we make the request using Net::HTTP.start and handle the response.
gistlibby LogSnag