lib/socketlabs/injectionapi/socketlabsclient.rb
# Sends a BasicMessage message and returns the response from the Injection API.
# @param [BasicMessage] message: A BasicMessage object to be sent.
# @return [SendResponse] the SendResponse from the request
Sends a BasicMessage message and returns the response from the Injection API.
Sends a BasicMessage message and returns the response from the Injection API .
def send_basic_message(message)
        resp = validate_message(message)
        if resp.result != SendResult.enum["Success"]
          resp
        end
        req_factory = InjectionRequestFactory.new(@server_id, @api_key)
        request = req_factory.generate_request(message)
        request_hash = request.to_hash
        debug_json = request_hash.to_json
        @request_json = debug_json
        http_request = HttpRequest.new(http_method, { :http_endpoint => @endpoint, :proxy => @proxy, :timeout => @request_timeout })
        retry_handler = RetryHandler.new(http_request, @endpoint, RetrySettings.new(@number_of_retries))
        response = retry_handler.send(request)
        parser = InjectionResponseParser.new
        parser.parse(response)
        @response_json = parser.to_json
      end
def send_basic_message ( message ) resp = validate_message ( message ) if resp . result != SendResult . enum [ "Success" ] resp end req_factory = InjectionRequestFactory . new ( @server_id , @api_key ) request = req_factory . generate_request ( message ) request_hash = request . to_hash debug_json = request_hash . to_json @request_json = debug_json http_request = HttpRequest . new ( http_method , { :http_endpoint => @endpoint , :proxy => @proxy , :timeout => @request_timeout } ) retry_handler = RetryHandler . new ( http_request , @endpoint , RetrySettings . new ( @number_of_retries ) ) response = retry_handler . send ( request ) parser = InjectionResponseParser . new parser . parse ( response ) @response_json = parser . to_json end
Sends a BasicMessage message and returns the response from the Injection API.
Sends a BasicMessage message and returns the response from the Injection API .
# debug
the SendResponse from the request
the SendResponse from the request
SendResponse
message
<not_specific>
<not_specific>
A BasicMessage object to be sent.
A BasicMessage object to be sent .