    # File lib/fog/joyent/compute.rb, line 145
            def request(request = {})
              request[:headers] = {
                "X-Api-Version" => @joyent_version,
                "Content-Type" => "application/json",
                "Accept" => "application/json"
              }.merge(request[:headers] || {}).merge(@header_method.call)

              if request[:body]
                request[:body] = Fog::JSON.encode(request[:body])
              end

              response = @connection.request(request)

              if response.headers["Content-Type"] == "application/json"
                response.body = json_decode(response.body)
              end

              raise_if_error!(request, response)

              response
            end