いろいろ試行錯誤したので、取り急ぎメモだけ。
#!/usr/bin/ruby require 'net/http' require 'uri' api_key = 'fxcxaxfxcx9x2x4xdxdx1x8x3xbxbxdx4x4x1xfx0x2x3' redmine_base = 'http://127.0.0.1:3000' project_identifier = 'tteesstt' wiki_title = 'testpage2' request_path = '/projects/' + project_identifier + '/wiki/' + wiki_title +'.xml' wiki_body = '' wiki_body << '' wiki_body << '' wiki_body << ' ' url = URI.parse(redmine_base + request_path) req = Net::HTTP::Put.new(url.path) req['Content-Type'] = 'text/xml' req['X-Redmine-Api-Key'] = api_key req.body = wiki_body res = Net::HTTP.start(url.host, url.port){ |http| http.request(req) } p res.bodyhogefuga ' wiki_body << 'ahhahha ' wiki_body << '
0 件のコメント:
コメントを投稿