0

I am trying to get PUT working with httpi. I am using curb (curl) as my adapter with gss negotiation (I need to use a Kerberos token). I am able to GET the article_to_update and I'm able to POST new articles using almost the exact same code (remove article_to_update from the URL and change put to post). With the code below I'm getting 408 errors: "Server timeout waiting for the HTTP request from the client." I've also tried an empty body and got the same results. Any ideas on how to get this working or to debug further?

Alternate (non-rails) solutions for kerberos-authenticated GET/PUT/POST implementations are welcomed as well. This is for a REST API but I didn't see if/how the rest-client gem supported kerberos.

require 'curb'
require 'httpi'
require 'json'

HTTPI.adapter = :curb
url = URI.escape('https://myserver.com/rest/article/article_to_update')
request = HTTPI::Request.new(url: url, open_timeout: 30)
request.headers['Content-Type'] = 'application/json'
request.headers['Accept'] = 'application/json'
request.auth.gssnegotiate
request.body = JSON.dump(
    name: 'discovery',
    owner: 'greg'
)
response = HTTPI.put(request)
Greg Ruhl
  • 1,060
  • 2
  • 9
  • 27
  • By any chance it is `Patch`? – Md. Farhan Memon Nov 02 '18 at 22:11
  • @Md.FarhanMemon, the API is reporting the following allowed access methods: `ACL, CANCELUPLOAD, CHECKIN, CHECKOUT, COPY, DELETE, GET, HEAD, LOCK, MKCALENDAR, MKCOL, MOVE, OPTIONS, POST, PROPFIND, PROPPATCH, PUT, REPORT, SEARCH, UNCHECKOUT, UNLOCK, UPDATE, VERSION-CONTROL` – Greg Ruhl Nov 05 '18 at 18:42

0 Answers0