LoginSignup
1
1

More than 5 years have passed since last update.

Windows Azure モバイルサービスでテーブル操作をREST APIで行う方法

Posted at

概要

  • モバイルサービスのテーブル操作(挿入・更新・削除・読み込み)をREST APIにて行う。
  • リクエストにはcurlコマンドを使う。

方法

コマンドの雛形は以下の通り。
見やすくするために改行をしていますが実際には改行しません。

挿入

curl https://<service_name>.azure-mobile.net/tables/<table_name>
-H "Accept: application/json" 
-H "X-ZUMO-APPLICATION: <アプリケーションキー> 
-H "Content-Type: application/json" 
-d ‘<JSONデータ>’ 

更新

curl —request PATCH https://<service_name>.azure-mobile.net/tables/<table_name>/<item_id>
-H "Accept: application/json" 
-H "X-ZUMO-APPLICATION: <アプリケーションキー> 
-H "Content-Type: application/json" 
-d ‘<JSONデータ>’ 

削除

curl —request DELETE https://<service_name>.azure-mobile.net/tables/<table_name>/<item_id>
-H "X-ZUMO-APPLICATION: <アプリケーションキー> 

参照(読み込み)

参照については、GETリクエストでパラメータを組み立てるだけなので説明は不要と思います。
詳細はレコードのクエリの操作(公式リファレンス)を参照して下さい。

その他

カスタムAPIのコマンド操作については、Azure Mobile Services でアクセス許可を制限した Custom API に カジュアルにアクセスするが参考になります。

参考

1
1
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
1
1