Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PUT example uses form data and lacks binary data example #1

Open
mlt opened this issue Jan 10, 2020 · 1 comment
Open

PUT example uses form data and lacks binary data example #1

mlt opened this issue Jan 10, 2020 · 1 comment

Comments

@mlt
Copy link

mlt commented Jan 10, 2020

It took me a while to figure out how to feed data to Apache Tika Server content analyzer as it wants simple PUT with binary file content.
The equivalent for

curl -T somestuff.dat http://localhost:9998/meta --header "Accept: application/json"

would be

uri = URI.parse('http://localhost:9998/meta')
http = Net::HTTP.new(uri.host, uri.port)
dat = File.read('somestuff.dat')
response = http.request_put(uri.path, dat, Accept: 'application/json', 'Content-Type': 'application/octet-stream')
@geraldb
Copy link
Member

geraldb commented Jan 10, 2020

Thanks for the PUT example with binary data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants