mirror of
https://github.com/jnunemaker/httparty
synced 2023-03-27 23:23:07 -04:00
14 lines
298 B
Ruby
14 lines
298 B
Ruby
# To upload file to a server use :body_stream
|
|
|
|
HTTParty.put(
|
|
'http://localhost:3000/train',
|
|
body_stream: File.open('sample_configs/config_train_server_md.yml', 'r')
|
|
)
|
|
|
|
|
|
# Actually, it works with any IO object
|
|
|
|
HTTParty.put(
|
|
'http://localhost:3000/train',
|
|
body_stream: StringIO.new('foo')
|
|
)
|