@@ -901,6 +901,8 @@ a query string and MsgPack without losing type information or value.
901901
902902The syntax is: ` {QUERY_ARG_NAME}=%{FMT_TYPE} `
903903
904+ Please look carefully for yours url encoding!
905+
904906A good example is (also see examples [ tnt_update] ( #tnt_update ) and [ tnt_upsert] ( #tnt_upsert ) ):
905907```
906908HTTP GET ... /url?space_id=512&value=some+string
@@ -949,8 +951,8 @@ Operations (for [tnt_upsert](#tnt_upsert))
949951
950952Examples can be found at:
951953
952- * ` ./t/ngx_confs/tnt_server_test.conf:342 `
953- * ` ./t/v26_features.py `
954+ * ` examples/simple_rest_client.py `
955+ * ` examples/simple_rest_client.sh `
954956
955957[ Back to contents] ( #contents )
956958
@@ -962,6 +964,10 @@ tnt_insert
962964
963965** context:** * location, location if*
964966
967+ ** HTTP methods** * GET, POST, PUT, PATCH, DELETE*
968+
969+ ** Content-Typer** * default, application/x-www-form-urlencoded*
970+
965971This directive allows executing an insert query with Tarantool.
966972
967973* The first argument is a space id.
@@ -989,6 +995,11 @@ Here is a description:
989995
990996 See "message"/"code" fields for details.
991997
998+ Examples can be found at:
999+
1000+ * ` simple_rest_client.py `
1001+ * ` simple_rest_client.sh `
1002+
9921003
9931004[ Back to contents] ( #contents )
9941005
@@ -1000,6 +1011,10 @@ tnt_replace
10001011
10011012** context:** * location, location if*
10021013
1014+ ** HTTP methods** * GET, POST, PUT, PATCH, DELETE*
1015+
1016+ ** Content-Typer** * default, application/x-www-form-urlencoded*
1017+
10031018This directive allows executing a replace query with Tarantool.
10041019
10051020* The first argument is a space id.
@@ -1027,6 +1042,11 @@ Here is a description:
10271042
10281043 See "message"/"code" fields for details.
10291044
1045+ Examples can be found at:
1046+
1047+ * ` examples/simple_rest_client.py `
1048+ * ` examples/simple_rest_client.sh `
1049+
10301050[ Back to contents] ( #contents )
10311051
10321052tnt_delete
@@ -1037,6 +1057,10 @@ tnt_delete
10371057
10381058** context:** * location, location if*
10391059
1060+ ** HTTP methods** * GET, POST, PUT, PATCH, DELETE*
1061+
1062+ ** Content-Typer** * default, application/x-www-form-urlencoded*
1063+
10401064This directive allows executing a delete query with Tarantool.
10411065
10421066* The first argument is a space id.
@@ -1065,6 +1089,11 @@ Here is a description:
10651089
10661090 See "message"/"code" fields for details.
10671091
1092+ Examples can be found at:
1093+
1094+ * ` examples/simple_rest_client.py `
1095+ * ` examples/simple_rest_client.sh `
1096+
10681097
10691098[ Back to contents] ( #contents )
10701099
@@ -1076,6 +1105,10 @@ tnt_select
10761105
10771106** context:** * location, location if*
10781107
1108+ ** HTTP methods** * GET, POST, PUT, PATCH, DELETE*
1109+
1110+ ** Content-Typer** * default, application/x-www-form-urlencoded*
1111+
10791112This directive allows executing a select query with Tarantool.
10801113
10811114* The first argument is a space id.
@@ -1109,6 +1142,11 @@ Here is a description:
11091142
11101143 See "message"/"code" fields for details.
11111144
1145+ Examples can be found at:
1146+
1147+ * ` examples/simple_rest_client.py `
1148+ * ` examples/simple_rest_client.sh `
1149+
11121150[ Back to contents] ( #contents )
11131151
11141152tnt_select_limit_max
@@ -1119,6 +1157,10 @@ tnt_select_limit_max
11191157
11201158** context:** * server, location, location if*
11211159
1160+ ** HTTP methods** * GET, POST, PUT, PATCH, DELETE*
1161+
1162+ ** Content-Typer** * default, application/x-www-form-urlencoded*
1163+
11221164This is a constraint to avoid * large selects* . This is the maximum number
11231165of returned tuples per select operation. If the client reaches this limit, then
11241166the client gets an error on its side.
@@ -1145,6 +1187,11 @@ Here is a description:
11451187
11461188 See "message"/"code" fields for details.
11471189
1190+ Examples can be found at:
1191+
1192+ * ` examples/simple_rest_client.py `
1193+ * ` examples/simple_rest_client.sh `
1194+
11481195[ Back to contents] ( #contents )
11491196
11501197tnt_allowed_spaces
@@ -1204,6 +1251,10 @@ tnt_update
12041251
12051252** context:** * location, location if*
12061253
1254+ ** HTTP methods** * GET, POST, PUT, PATCH, DELETE*
1255+
1256+ ** Content-Typer** * default, application/x-www-form-urlencoded*
1257+
12071258This directive allows executing an update query with Tarantool.
12081259
12091260* The first argument is a space id.
@@ -1233,72 +1284,10 @@ section [1].
12331284
12341285* The third argument is a [ format] ( #format ) string.
12351286
1236- [ 1] Example
1237-
1238- it is just an example, it does not contain any tuning settings and
1239- additinitional validation!
1240-
1241- * nginx.conf
1242- ``` nginx.conf
1243- # ...
1244- upstrean backend {
1245- server 127.0.0.1:3113;
1246- }
1247-
1248- # ...
1249- location /delete {
1250- tnt_delete 512 0 "id=%n";
1251- tnt_pass tnt;
1252- }
1253- location /select {
1254- tnt_select 512 0 0 100 ge "id=%n";
1255- tnt_pass tnt;
1256- }
1257- location /update {
1258- tnt_update 512 "id=%kn" "value=%s,value1=%f";
1259- tnt_pass tnt;
1260- }
1261- location /insert {
1262- tnt_insert 512 "id=%kn" "value=%s,value1=%f";
1263- tnt_pass backend;
1264- }
1265-
1266- ```
1267-
1268- * Tarantool
1269- ``` lua
1270- -- ...
1271-
1272- box .cfg {listen = 3113 }
1273-
1274- -- ...
1275- t = box .schema .space .create (' t1' , {if_not_exists = true })
1276- t :create_index (' pk' , {if_not_exists = true })
1277- ```
1278-
1279- * Client request
1280- ``` bash
1281- $ curl -X POST -d id=3113 http://127.0.0.1:8081/insert
1282- {" id" :0," result" :[[3113]]}
1283-
1284- $ curl ' http://127.0.0.1:8081/select?id=3113'
1285- {" id" :0," result" :[[3113]]}
1286-
1287- $ curl -X POST -d id=3113 -d ' value==,1,Delta compression using up to 4 threads.' -d value1==,2,3.14 http://127.0.0.1:8081/update_post
1288- {" id" :0," result" :[[3113," Delta compression using up to 4 threads." ,3.140000]]}+
1289-
1290- # ## NOTICE! %2B is urlescaped('+')
1291- $ curl -X POST -d id=3113 -d value1=%2B,2,5.14 http://127.0.0.1:8081/update {" id" :0," result" :[[3113," Delta compression using up to 4 threads." ,8.280000]]}
1292-
1293- $ curl ' http://127.0.0.1:8081/select?id=3113'
1294- {" id" :0," result" :[[3113," Delta compression using up to 4 threads." ,8.280000]]}
1295-
1296- curl -X POST -d id=3113 http://127.0.0.1:8081/delete
1297- {" id" :0," result" :[[3113," Delta compression using up to 4 threads." ,8.280000]]}
1287+ Examples can be found at:
12981288
1299- curl ' http://127.0.0.1:8081/select?id=3113'
1300- {" id" :0," result" :[]}
1301- ```
1289+ * ` examples/simple_rest_client.py `
1290+ * ` examples/simple_rest_client.sh `
13021291
13031292Returns HTTP code 4XX if client's request doesn't well formatted. It means, that
13041293this error raised if some of values missed or has wrong type.
@@ -1332,6 +1321,10 @@ tnt_upsert
13321321
13331322** context:** * location, location if*
13341323
1324+ ** HTTP methods** * GET, POST, PUT, PATCH, DELETE*
1325+
1326+ ** Content-Typer** * default, application/x-www-form-urlencoded*
1327+
13351328This directive allows executing an upsert query with Tarantool.
13361329
13371330* The first argument is a space id.
@@ -1363,39 +1356,10 @@ section [1].
13631356
13641357[ 1] Example
13651358
1366- it is just an example, it does not contain any tuning settings and
1367- additinitional validation!
1368-
1369- * nginx.conf
1370- ``` nginx.conf
1371- # ...
1372- upstrean backend {
1373- server 127.0.0.1:3113;
1374- }
1375-
1376- # ...
1377- location /upsert {
1378- tnt_delete 512 0 "new_id=%n,new_value=%s" "updated_value=%os";
1379- tnt_pass tnt;
1380- }
1381- ```
1382-
1383- * Tarantool
1384- ``` lua
1385- -- ...
1386-
1387- box .cfg {listen = 3113 }
1388-
1389- -- ...
1390- local t = box .schema .space .create (' t1' , {if_not_exists = true })
1391- t :create_index (' pk' , {if_not_exists = true })
1392- ```
1359+ Examples can be found at:
13931360
1394- * Client request
1395- ``` bash
1396- $ curl -X POST -d new_id=3113 -d new_value=str -d updated_value==,2,ustr http://127.0.0.1:8081/upsert
1397- {" id" :0," result" :[[3113, " ustr" ]]}
1398- ```
1361+ * ` examples/simple_rest_client.py `
1362+ * ` examples/simple_rest_client.sh `
13991363
14001364Returns HTTP code 4XX if client's request doesn't well formatted. It means, that
14011365this error raised if some of values missed or has wrong type.
0 commit comments