所以這與我在此method上發表的一篇早期文章有關。這基本上是我在用通過hipchat發送文件:紅寶石hipchat寶石無效發送文件
#!/usr/bin/env ruby
require 'hipchat'
client = HipChat::Client.new('HIPCHAT_TOKEN', :api_version => 'v2', :server_url => 'HIPCHAT_URL')
client.user('some_username').send_file('message', File.open('./output/some-file.csv'))
client['some_hipchat_room'].send_file('some_user', 'message', File.open('./output/some-file.csv'))
現在,由於某種原因,由send_file方法是無效的:
/path/to/gems/hipchat-1.5.4/lib/hipchat/errors.rb:40:in `response_code_to_exception_for': You requested an invalid method. path:https://hipchat.illum.io/v2/user/[email protected]/share/file?auth_token=asdfgibberishasdf method:Net::HTTP::Get (HipChat::MethodNotAllowed)
from /path/to/gems/gems/hipchat-1.5.4/lib/hipchat/user.rb:50:in `send_file'
我認爲這表明你應該使用POST而不是GET,但我不確定,因爲我沒有使用過這個庫和Hipchat。 –
您使用的是什麼版本的寶石? '貓Gemfile.lock | grep hipchat' –
'hipchat(1.5.4)' –