Module: Relax2::Interceptors
- Defined in:
- lib/relax2/interceptors.rb
Defined Under Namespace
Classes: PrintRequest, PrintResponse
Class Method Summary
collapse
Class Method Details
.json_request ⇒ Object
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. << ['Accept', 'application/json']
request. << ['Content-Type', 'application/json']
perform_request.call(request)
end
end
|
.print_response ⇒ Object
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_request ⇒ Object
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_response ⇒ Object
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
|