From dea59aba0559b9292c5aed3846f392400371fe20 Mon Sep 17 00:00:00 2001 From: HAHWUL Date: Sat, 29 Jun 2024 00:46:02 +0900 Subject: [PATCH] Add request/response --- lib/caido/helpers/request.rb | 34 ++++++++++++++++++++++++++++++++++ lib/caido/helpers/response.rb | 19 +++++++++++++++++++ 2 files changed, 53 insertions(+) create mode 100644 lib/caido/helpers/request.rb create mode 100644 lib/caido/helpers/response.rb diff --git a/lib/caido/helpers/request.rb b/lib/caido/helpers/request.rb new file mode 100644 index 0000000..1a20e73 --- /dev/null +++ b/lib/caido/helpers/request.rb @@ -0,0 +1,34 @@ +# frozen_string_literal: true + +module Caido + # Instance class + class Instance + def request(id) + query("query{ + request(id:\"#{id}\"){ + id + host + method + query + length + port + isTls + fileExtension + source + alteration + edited + createdAt + raw + response{ + id + statusCode + length + roundtripTime + edited + raw + } + } + }")['request'] + end + end +end diff --git a/lib/caido/helpers/response.rb b/lib/caido/helpers/response.rb new file mode 100644 index 0000000..7f10fe3 --- /dev/null +++ b/lib/caido/helpers/response.rb @@ -0,0 +1,19 @@ +# frozen_string_literal: true + +module Caido + # Instance class + class Instance + def response(id) + query("query{ + response(id:\"#{id}\"){ + id + statusCode + length + roundtripTime + edited + raw + } + }")['response'] + end + end +end