Skip to content

undefined method `+@' for "":String #733

@khiav223577

Description

@khiav223577

Reproduction Steps

HTTParty.get('http://google.com/search', query: { search: 'httparty' }).parsed_response

Will get this error:

NoMethodError: undefined method `+@' for "":String
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/hash_conversions.rb:31:in `normalize_param'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/hash_conversions.rb:19:in `block in to_params'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/hash_conversions.rb:19:in `each'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/hash_conversions.rb:19:in `map'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/hash_conversions.rb:19:in `to_params'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/request.rb:200:in `normalize_query'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/request.rb:266:in `query_string'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/request.rb:109:in `uri'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/request.rb:215:in `setup_raw_request'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty/request.rb:143:in `perform'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty.rb:613:in `perform_request'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty.rb:527:in `get'
        from /home/khiav/.rvm/gems/ruby-2.2.10/gems/httparty-0.19.0/lib/httparty.rb:646:in `get'
        from (irb):2
        from /home/khiav/.rvm/rubies/ruby-2.2.10/bin/irb:11:in `<main>'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions