apache tika - ruby and net/http request without content-type -
i'm trying make call tika server using net::http::put. issue call passes content-type
, keeps tika running detectors (which want) , chokes due default content-type
of application/x-www-form-urlencoded
. tika docs suggest not use that.
so, have following:
require 'net/http' port = 9998 host = "localhost" path = "/meta" req = net::http::put.new(path) req.body_stream = file.open(file_name) req['transfer-encoding'] = 'chunked' req['accept'] = 'application/json' response = net::http.new(host, port).start { |http| http.request(req) }
i tried adding req.delete('content-type')
, setting initheaders = {}
in various ways, default content-type
keeps getting sent.
any insights appreciated, since rather avoid having make multiple curl calls ... there way suppress sending of default header?
if set req['content-type'] = nil
net::http set default of 'application/x-www-form-urlencoded', if set blank string net::http leaves alone:
req['content-type'] = ''
tika should see invalid type , enable detectors.
Comments
Post a Comment