There are usecases when users of the SDK need to perform custom logic before the request is sent or response is parsed, so they can add context to exception monitoring platforms.
This change also adds the following two hooks:
Client#before_submitting_request
Client#before_parsing_response
These hooks can be used like so:
client = ZATCA::Client.new(username: "user", password: "pass", verbose: true)
client.before_submitting_request = proc do |method, url, body, headers|
# method is a symbol
# url is a string
# body and headers are hashes
end
client.before_parsing_response = proc do |response|
# Response is an instance of HTTPX::Response or HTTPX::ErrorResponse
end
There are usecases when users of the SDK need to perform custom logic before the request is sent or response is parsed, so they can add context to exception monitoring platforms.
This change also adds the following two hooks:
Client#before_submitting_request
Client#before_parsing_response
These hooks can be used like so: