def json_request(request_class, path, data = {}, header = {})
      Itrp::Attachments.new(self).upload_attachments!(path, data)
      request = request_class.new(expand_path(path), expand_header(header))
      body = {}
      data.each{ |k,v| body[k.to_s] = typecast(v, false) }
      request.body = body.to_json
      request
    end
def json_request(request_class, path, data = {}, header = {})
      Itrp::Attachments.new(self).upload_attachments!(path, data)
      request = request_class.new(expand_path(path), expand_header(header))
      body = {}
      data.each{ |k,v| body[k.to_s] = typecast(v, false) }
      request.body = body.to_json
      request
    end
create a request (place data in body if the request becomes too large)