xref: /curl/tests/data/test421 (revision a9e128d5)
1<testcase>
2<info>
3<keywords>
4header_json
5</keywords>
6</info>
7
8#
9# Server-side
10<reply>
11<data crlf="yes">
12HTTP/1.1 200 OK
13server: nginx
14date: Tue, 07 Mar 2023 15:14:41 GMT
15content-type: application/json
16content-length: 6
17vary: Accept-Encoding
18access-control-allow-origin: *
19vary: Accept-Encoding
20referrer-policy: strict-origin-when-cross-origin
21access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS
22access-control-max-age: 1728000
23access-control-allow-headers: Authorization, Content-Type, AuthorizationOauth, X-EARLY-ACCESS
24access-control-expose-headers:
25vary: Accept
26etag: W/"2678f9ab2ba550d164e7cc014aefd31e"
27cache-control: max-age=0, private, must-revalidate
28x-request-id: 375b343b3d2ecf9b442c0daf00fc4a9a
29strict-transport-security: max-age=31536000; includeSubDomains
30x-content-type-options: nosniff
31x-xss-protection: 1; mode=block
32referrer-policy: strict-origin-when-cross-origin
33feature-policy: accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment 'none'; usb 'none'
34
35-foo-
36</data>
37</reply>
38
39#
40# Client-side
41<client>
42<server>
43http
44</server>
45<name>
46HTTP GET multiple headers and %{header_json}
47</name>
48<command>
49http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%{stderr}%{header_json}\n' -s
50</command>
51</client>
52
53#
54# Verify data after the test has been "shot"
55<verify>
56<protocol crlf="yes">
57GET /%TESTNUMBER HTTP/1.1
58Host: %HOSTIP:%HTTPPORT
59User-Agent: curl/%VERSION
60Accept: */*
61
62</protocol>
63<stderr mode="text">
64{"server":["nginx"],
65"date":["Tue, 07 Mar 2023 15:14:41 GMT"],
66"content-type":["application/json"],
67"content-length":["6"],
68"vary":["Accept-Encoding","Accept-Encoding","Accept"],
69"access-control-allow-origin":["*"],
70"referrer-policy":["strict-origin-when-cross-origin","strict-origin-when-cross-origin"],
71"access-control-allow-methods":["GET, POST, PUT, DELETE, OPTIONS"],
72"access-control-max-age":["1728000"],
73"access-control-allow-headers":["Authorization, Content-Type, AuthorizationOauth, X-EARLY-ACCESS"],
74"access-control-expose-headers":[""],
75"etag":["W/\"2678f9ab2ba550d164e7cc014aefd31e\""],
76"cache-control":["max-age=0, private, must-revalidate"],
77"x-request-id":["375b343b3d2ecf9b442c0daf00fc4a9a"],
78"strict-transport-security":["max-age=31536000; includeSubDomains"],
79"x-content-type-options":["nosniff"],
80"x-xss-protection":["1; mode=block"],
81"feature-policy":["accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment 'none'; usb 'none'"]
82}
83</stderr>
84</verify>
85</testcase>
86