2
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Outsystems】HEADメソッドのAPIをRequestする

Posted at

初めに

AzureBlobからファイルを取得するServerActionを作成した。
ファイルを取得する際にファイルサイズを確認し、一定サイズ以下であれば受け入れるようにしたい。
AzureBlobのプロパティ取得のAPIはHEADメソッドでRequestする必要がある。
ところがOutsystems標準のConsume REST APIではHEADメソッドを選択できない。

環境

Service Studio Version 11.54.37

標準で選択できるHTTP Method

  • GET
  • POST
  • PUT
  • DELETE
  • PATCH

Consume REST APIでHTTPMethodをHEADに変更するには

Consume REST APIでは、リクエスト前にHeaderなどをOnBeforeRequestでカスタマイズできる。
この方法を使ってHTTPMethodを上書きできそう。
REST APIを利用する/シンプルなカスタマイズ

もともとのRequestを読み込んで、CustomizedRequestを送信することができる。
image.png

このRequestとCustomizedRequestの中にHTTPMethodというAttributeが存在している。
image.png

確認すると、各メソッドでのConsume REST APIを実行したとき、選択したメソッドが設定されている。

image.png

これを上書きすることでOutsystems ConsumeAPIの標準で選択できないHTTPMethodのAPIをRequestすることができた。

image.png

まとめ

OutsystemsでHEADメソッドのAPIをRequestするには、OnBeforeRequestでCustomizedRequest.HTTPMethodを"HEAD"で上書きすればよい。

2
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?