lib/two_captcha/client.rb
def upload(options = {})
      args = {}
      args[:body]   = options[:raw64] if options[:raw64]
      args[:method] = options[:method] || 'base64'
      args.merge!(options)
      response = request('in', :multipart, args)

      unless response.match(/\AOK\|/)
        fail(TwoCaptcha::Error, 'Unexpected API Response')
      end

      TwoCaptcha::Captcha.new(
        id: response.split('|', 2)[1],
        api_response: response
      )
    end
def upload(options = {})
      args = {}
      args[:body]   = options[:raw64] if options[:raw64]
      args[:method] = options[:method] || 'base64'
      args.merge!(options)
      response = request('in', :multipart, args)

      unless response.match(/\AOK\|/)
        fail(TwoCaptcha::Error, 'Unexpected API Response')
      end

      TwoCaptcha::Captcha.new(
        id: response.split('|', 2)[1],
        api_response: response
      )
    end
def upload ( options = { } ) args = { } args [ :body ] = options [ :raw64 ] if options [ :raw64 ] args [ :method ] = options [ :method ] || 'base64' args . merge! ( options ) response = request ( 'in' , :multipart , args ) unless response . match ( / \A \| / ) fail ( TwoCaptcha :: Error , 'Unexpected API Response' ) end TwoCaptcha :: Captcha . new ( id : response . split ( '|' , 2 ) [ 1 ] , api_response : response ) end
Upload a captcha to 2Captcha.

 This method will not return the solution. It helps on separating concerns.

 @return [TwoCaptcha::Captcha] The captcha object (not solved yet).
Upload a captcha to 2Captcha .