V
V
Vayladion Gognazdiak2017-03-14 14:54:26
ruby
Vayladion Gognazdiak, 2017-03-14 14:54:26

How to defeat urlencoded body on post request via HTTParty?

Good day.
There is a server on which from time to time it is required to post some information (I will make a reservation right away - not spam).
You can do this through the browser - on the page there is a regular form for a post, or you can automate it in some way.
There is a code:

class Poster
include HTTParty
....
  def post_comment(text)
    resp = self.class.post('/posting.fcgi',
    :body => {
         :comment => text})
  end

...

end

@p = Poster.new
@p.post_comment('Est tut kto jivoy?')

As a result of the post, the text turns into 'Est%20tut%20kto%20jivoy%3F' I looked at the
encoding - utf8. There is a suspicion that these are features of Perl on a server.
Tell me where to dig?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question