2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

httpclientで疑似RESTを使用しPUT、DELTE etcを実現

Posted at

ブラウザやサーバサイドでGet、Postを受付けない設定になっている場合、疑似RESTでputなどの代行ができます。ここではhttp_clientを使用してRESTに対応したデータの送信を記述します。
_methodに対応メソッドを指定してやれば良いので、下記のように記述することで代用できます。

httpclient.post(
  "https://xxxx/api/v3/projects/:id/issues/:issue_id",
  {'_method'=>'put',
  'private_token' => 'token',
  'state_event'=>'closed'
})
2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?