suchowan/watson-api-client

call to `rest_access_with_body` wont accept any format of the :body [ WatsonAPIClient::Discovery ]

Opened this issue · 1 comments

While calling WatsonAPIClient::Discovery.updateEnvironment always get 415 Unsupported Media Type for any format of :body

swagger reference: on https://watson-api-explorer.ng.bluemix.net/listings/discovery-v1.json search for operationId: "updateEnvironment"

Code

service = WatsonAPIClient::Discovery.new(
                                             :user=>"#{username}",
                                             :password=>"#{password}",
                                             :verify_ssl=>OpenSSL::SSL::VERIFY_NONE)

service.updateEnvironment(
      environment_id: "#{env_id}",
      version: "2018-03-05",
      body: p 
    )

This might be a problem with RestClient itself since I tried hard coding the :payload on the put(payload, additional_headers={}, &block) method. It wouldn't accept these: Object, Hash, String, Json String, always returning 415 Unsupported Media Type.

watson-api-client (0.0.8)
rest-client (2.0.2)

Although it is not a complete measure, I tried to deal with it.
Please see commit 69355c3 .