Module: Relax2::Interceptors

Defined in:
lib/relax2/interceptors.rb

Defined Under Namespace

Classes: PrintRequest, PrintResponse

Class Method Summary collapse

Class Method Details

.json_requestObject



70
71
72
73
74
75
76
# File 'lib/relax2/interceptors.rb', line 70

module_function def json_request
  lambda do |request, perform_request|
    request.headers << ['Accept', 'application/json']
    request.headers << ['Content-Type', 'application/json']
    perform_request.call(request)
  end
end


62
63
64
# File 'lib/relax2/interceptors.rb', line 62

module_function def print_response
  PrintResponse.new(print_status: false, print_headers: false)
end

.verbose_print_requestObject



58
59
60
# File 'lib/relax2/interceptors.rb', line 58

module_function def verbose_print_request
  PrintRequest.new(print_headers: true, print_body: true)
end

.verbose_print_responseObject



66
67
68
# File 'lib/relax2/interceptors.rb', line 66

module_function def verbose_print_response
  PrintResponse.new(print_status: true, print_headers: true)
end