lib/cs/auth/oauth.rb
# convert the body to hash if response is "application/json"
convert the body to hash if response is "application/json"
convert the body to hash if response is " application / json "
def parse_response(response)
        @response_body = response.content_type == "application/json" ? (JSON(response.body) rescue nil) : response.body
        @response_code = response.code.to_i
        @response_headers = response.to_hash
        @response_headers.each do |k,v|
          @response_headers[k] = v[0] rescue nil
        end
        if @response_code >= 400
          @errors = [response_body['error']]
        end
      end
def parse_response ( response ) @response_body = response . content_type == "application/json" ? ( JSON ( response . body ) rescue nil ) : response . body @response_code = response . code . to_i @response_headers = response . to_hash @response_headers . each do | k , v | @response_headers [ k ] = v [ 0 ] rescue nil end if @response_code >= 400 @errors = [ response_body [ 'error' ] ] end end
convert the body to hash if response is "application/json"
convert the body to hash if response is " application / json "
response
<not_specific>