-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrequests.txt
60 lines (49 loc) · 5.03 KB
/
requests.txt
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
1) Get maximum value in file:
curl -H 'Content-Type: application/json' -s -XPOST http://localhost:8081/api/get_max_value -d '{"path_file":"C:/test_data/10m.txt"}'
curl -H 'Content-Type: application/xml' -s -XPOST http://localhost:8081/api/get_max_value -d '<data><path_file>C:/test_data/10m.txt</path_file><operation>null</operation></data>'
Response: {"max_value":49999978}
2) Get minimum value in file:
curl -H 'Content-Type: application/json' -s -XPOST http://localhost:8081/api/get_min_value -d '{"path_file":"C:/test_data/10m.txt"}'
curl -H 'Content-Type: application/xml' -s -XPOST http://localhost:8081/api/get_min_value -d '<data><path_file>C:/test_data/10m.txt</path_file><operation>null</operation></data>'
Response: {"min_value":-49999996}
3) Get median:
curl -H 'Content-Type: application/json' -s -XPOST http://localhost:8081/api/get_median -d '{"path_file":"C:/test_data/10m.txt"}'
curl -H 'Content-Type: application/xml' -s -XPOST http://localhost:8081/api/get_median -d '<data><path_file>C:/test_data/10m.txt</path_file><operation>null</operation></data>'
Response: {"median":25216.0}
4) Get Arithmetic mean:
curl -H 'Content-Type: application/json' -s -XPOST http://localhost:8081/api/get_arithmetic_mean -d '{"path_file":"C:/test_data/10m.txt"}'
curl -H 'Content-Type: application/xml' -s -XPOST http://localhost:8081/api/get_arithmetic_mean -d '<data><path_file>C:/test_data/10m.txt</path_file><operation>null</operation></data>'
Response: {"arithmetic_mean":7364.0}
5) Get longest sequence of consecutive numbers that increases:
curl -H 'Content-Type: application/json' -s -XPOST http://localhost:8081/api/get_max_asc_sequence -d '{"path_file":"C:/test_data/10m.txt"}'
curl -H 'Content-Type: application/xml' -s -XPOST http://localhost:8081/api/get_max_asc_sequence -d '<data><path_file>C:/test_data/10m.txt</path_file><operation>null</operation></data>'
Response: {"sequences_ASC":{"1":[-48190694,-47725447,-43038241,-20190291,-17190728,-6172572,8475960,25205909,48332507,48676185]}}
6) Get longest sequence of consecutive numbers that decreases:
curl -H 'Content-Type: application/json' -s -XPOST http://localhost:8081/api/get_max_desc_sequence -d '{"path_file":"C:/test_data/10m.txt"}'
curl -H 'Content-Type: application/xml' -s -XPOST http://localhost:8081/api/get_max_desc_sequence -d '<data><path_file>C:/test_data/10m.txt</path_file><operation>null</operation></data>'
Response: {"sequences_DESC":{"1":[47689379,42381213,30043880,12102356,-4774057,-5157723,-11217378,-23005285,-23016933,-39209115,-49148762]}}
7) Get requested operation:
- get_max_value:
curl -H 'Content-Type: application/json' -s -XPOST http://localhost:8081/api/ -d '{"path_file":"C:/test_data/10m.txt","operation":"get_max_value"}'
curl -H 'Content-Type: application/xml' -s -XPOST http://localhost:8081/api/ -d '<data><path_file>C:/test_data/10m.txt</path_file><operation>get_max_value</operation></data>'
Response: {"max_value":49999978}
- get_min_value:
curl -H 'Content-Type: application/json' -s -XPOST http://localhost:8081/api/ -d '{"path_file":"C:/test_data/10m.txt","operation":"get_min_value"}'
curl -H 'Content-Type: application/xml' -s -XPOST http://localhost:8081/api/ -d '<data><path_file>C:/test_data/10m.txt</path_file><operation>get_min_value</operation></data>'
Response: {"min_value":-49999996}
- get_median:
curl -H 'Content-Type: application/json' -s -XPOST http://localhost:8081/api/ -d '{"path_file":"C:/test_data/10m.txt","operation":"get_median"}'
curl -H 'Content-Type: application/xml' -s -XPOST http://localhost:8081/api/ -d '<data><path_file>C:/test_data/10m.txt</path_file><operation>get_median</operation></data>'
Response: {"median":25216.0}
- get_arithmetic_mean:
curl -H 'Content-Type: application/json' -s -XPOST http://localhost:8081/api/ -d '{"path_file":"C:/test_data/10m.txt","operation":"get_arithmetic_mean"}'
curl -H 'Content-Type: application/xml' -s -XPOST http://localhost:8081/api/ -d '<data><path_file>C:/test_data/10m.txt</path_file><operation>get_arithmetic_mean</operation></data>'
Response: {"arithmetic_mean":7364.0}
- get_max_asc_sequence:
curl -H 'Content-Type: application/json' -s -XPOST http://localhost:8081/api/ -d '{"path_file":"C:/test_data/10m.txt","operation":"get_max_asc_sequence"}'
curl -H 'Content-Type: application/xml' -s -XPOST http://localhost:8081/api/ -d '<data><path_file>C:/test_data/10m.txt</path_file><operation>get_max_asc_sequence</operation></data>'
Response: {"sequences_ASC":{"1":[-48190694,-47725447,-43038241,-20190291,-17190728,-6172572,8475960,25205909,48332507,48676185]}}
- get_max_desc_sequence:
curl -H 'Content-Type: application/json' -s -XPOST http://localhost:8081/api/ -d '{"path_file":"C:/test_data/10m.txt","operation":"get_max_desc_sequence"}'
curl -H 'Content-Type: application/xml' -s -XPOST http://localhost:8081/api/ -d '<data><path_file>C:/test_data/10m.txt</path_file><operation>get_max_desc_sequence</operation></data>'
Response: {"sequences_DESC":{"1":[47689379,42381213,30043880,12102356,-4774057,-5157723,-11217378,-23005285,-23016933,-39209115,-49148762]}}