How do I make a POST request with open-uri?

后端 未结 4 1771
一向
一向 2020-12-08 07:27

Is it possible to make a POST request from Ruby with open-uri?

4条回答
  •  忘掉有多难
    2020-12-08 07:54

    Unfortunately open-uri only supports the GET verb.

    You can either drop down a level and use net/http, or use rest-open-uri, which was designed to support POST and other verbs. You can do gem install rest-open-uri to install it.

提交回复
热议问题