-
Notifications
You must be signed in to change notification settings - Fork 1
/
testpost.sh
executable file
·77 lines (67 loc) · 2.03 KB
/
testpost.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/usr/bin/env bash
set -e
set -x
PORT=${PORT:-3001}
cp ~/tdata/lastpushes/* testdata/
curl -X POST \
-H "Content-Type: application/json" \
-H "AuthorizationOfCats: mytoken" \
-d @testdata/ia.json \
http://localhost:3001/populate/
curl -X POST \
-H "Content-Type: application/json" \
-H "AuthorizationOfCats: mytoken" \
-d @testdata/rye.json \
http://localhost:3001/populate/
# ! FIXME: This doesn't work:
#
# 2024/02/02 09:04:59 POST /populate/ HTTP/1.1
# Host: localhost:3001
# Accept: */*
# Authorizationofcats: mytoken
# Content-Length: 70992
# Content-Type: application/json
# Expect: 100-continue
# User-Agent: curl/7.68.0
#
#
# 2024/02/02 09:04:59 Decoding 70992 bytes
# 2024/02/02 09:04:59 attempting decode as ndjson instead..., length: 2 []
# 2024/02/02 09:04:59 Decoded 0 features
# 2024/02/02 09:04:59 POST /populate/ HTTP/1.1
# Host: localhost:3001
# Accept: */*
# Authorizationofcats: mytoken
# Content-Length: 65506
# Content-Type: application/json
# Expect: 100-continue
# User-Agent: curl/7.68.0
#
#
# 2024/02/02 09:04:59 Decoding 65506 bytes
# 2024/02/02 09:04:59 attempting decode as ndjson instead..., length: 2 []
# 2024/02/02 09:04:59 Decoded 0 features
#
# curl -X POST \
# -H "Content-Type: application/json" \
# -H "AuthorizationOfCats: mytoken" \
# -d @testdata/ia.ndgeojson http://localhost:3001/populate/
#
# curl -X POST \
# -H "Content-Type: application/json" \
# -H "AuthorizationOfCats: mytoken" \
# -d @testdata/rye.ndgeojson http://localhost:3001/populate/
# curl -X POST \
# -H "Content-Type: application/json" \
# -H "AuthorizationOfCats: mytoken" \
# -d @testdata/trackpoints.json http://localhost:3001/populate/
#
# curl -X POST \
# -H "Content-Type: application/json" \
# -H "AuthorizationOfCats: mytoken" \
# -d @testdata/lastknown-rye.geojson http://localhost:3001/populate/
#
# curl -X POST \
# -H "Content-Type: application/json" \
# -H "AuthorizationOfCats: mytoken" \
# -d @testdata/lastknown-ia.geojson http://localhost:3001/populate/