xref: /third_party/curl/tests/data/test1052 (revision 13498266)
113498266Sopenharmony_ci<testcase>
213498266Sopenharmony_ci<info>
313498266Sopenharmony_ci<keywords>
413498266Sopenharmony_ciHTTP
513498266Sopenharmony_ciHTTP PUT
613498266Sopenharmony_cifollowlocation
713498266Sopenharmony_ci</keywords>
813498266Sopenharmony_ci
913498266Sopenharmony_ci</info>
1013498266Sopenharmony_ci# Server-side
1113498266Sopenharmony_ci<reply>
1213498266Sopenharmony_ci<data>
1313498266Sopenharmony_ciHTTP/1.0 301 Redirect swsclose
1413498266Sopenharmony_ciDate: Thu, 29 Jul 2008 14:49:00 GMT
1513498266Sopenharmony_ciServer: test-server/fake
1613498266Sopenharmony_ciLocation: data/%TESTNUMBER0002.txt?coolsite=yes
1713498266Sopenharmony_ciContent-Length: 0
1813498266Sopenharmony_ciConnection: close
1913498266Sopenharmony_ci
2013498266Sopenharmony_ci</data>
2113498266Sopenharmony_ci<data2>
2213498266Sopenharmony_ciHTTP/1.0 200 Followed here fine swsclose
2313498266Sopenharmony_ciDate: Thu, 29 Jul 2008 14:49:00 GMT
2413498266Sopenharmony_ciServer: test-server/fake
2513498266Sopenharmony_ciContent-Length: 51
2613498266Sopenharmony_ci
2713498266Sopenharmony_ciIf this is received, the location following worked
2813498266Sopenharmony_ci</data2>
2913498266Sopenharmony_ci<datacheck>
3013498266Sopenharmony_ciHTTP/1.0 301 Redirect swsclose
3113498266Sopenharmony_ciDate: Thu, 29 Jul 2008 14:49:00 GMT
3213498266Sopenharmony_ciServer: test-server/fake
3313498266Sopenharmony_ciLocation: data/%TESTNUMBER0002.txt?coolsite=yes
3413498266Sopenharmony_ciContent-Length: 0
3513498266Sopenharmony_ciConnection: close
3613498266Sopenharmony_ci
3713498266Sopenharmony_ciHTTP/1.0 200 Followed here fine swsclose
3813498266Sopenharmony_ciDate: Thu, 29 Jul 2008 14:49:00 GMT
3913498266Sopenharmony_ciServer: test-server/fake
4013498266Sopenharmony_ciContent-Length: 51
4113498266Sopenharmony_ci
4213498266Sopenharmony_ciIf this is received, the location following worked
4313498266Sopenharmony_ci</datacheck>
4413498266Sopenharmony_ci</reply>
4513498266Sopenharmony_ci
4613498266Sopenharmony_ci# Client-side
4713498266Sopenharmony_ci<client>
4813498266Sopenharmony_ci<server>
4913498266Sopenharmony_cihttp
5013498266Sopenharmony_ci</server>
5113498266Sopenharmony_ci<name>
5213498266Sopenharmony_ciHTTP 1.0 PUT with Location: following
5313498266Sopenharmony_ci</name>
5413498266Sopenharmony_ci<command>
5513498266Sopenharmony_cihttp://%HOSTIP:%HTTPPORT/want/%TESTNUMBER -0 -L -T %LOGDIR/test%TESTNUMBER.txt
5613498266Sopenharmony_ci</command>
5713498266Sopenharmony_ci<file name="%LOGDIR/test%TESTNUMBER.txt">
5813498266Sopenharmony_ciWeird
5913498266Sopenharmony_ci     file
6013498266Sopenharmony_ci         to
6113498266Sopenharmony_ci   upload
6213498266Sopenharmony_cifor
6313498266Sopenharmony_ci   testing
6413498266Sopenharmony_cithe
6513498266Sopenharmony_ci   PUT
6613498266Sopenharmony_ci      feature
6713498266Sopenharmony_ci</file>
6813498266Sopenharmony_ci</client>
6913498266Sopenharmony_ci
7013498266Sopenharmony_ci# Verify data after the test has been "shot"
7113498266Sopenharmony_ci<verify>
7213498266Sopenharmony_ci
7313498266Sopenharmony_ci# The primary reason libcurl sends the data part twice in this test is that
7413498266Sopenharmony_ci# the test HTTP server is blocking until it has read the entire request,
7513498266Sopenharmony_ci# including the full request-body before it responds. So in this test the
7613498266Sopenharmony_ci# server says 301 and 200 _after_ the entire PUT body has been sent.
7713498266Sopenharmony_ci<protocol>
7813498266Sopenharmony_ciPUT /want/%TESTNUMBER HTTP/1.0
7913498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
8013498266Sopenharmony_ciUser-Agent: curl/%VERSION
8113498266Sopenharmony_ciAccept: */*
8213498266Sopenharmony_ciContent-Length: 78
8313498266Sopenharmony_ci
8413498266Sopenharmony_ciWeird
8513498266Sopenharmony_ci     file
8613498266Sopenharmony_ci         to
8713498266Sopenharmony_ci   upload
8813498266Sopenharmony_cifor
8913498266Sopenharmony_ci   testing
9013498266Sopenharmony_cithe
9113498266Sopenharmony_ci   PUT
9213498266Sopenharmony_ci      feature
9313498266Sopenharmony_ciPUT /want/data/%TESTNUMBER0002.txt?coolsite=yes HTTP/1.0
9413498266Sopenharmony_ciHost: %HOSTIP:%HTTPPORT
9513498266Sopenharmony_ciUser-Agent: curl/%VERSION
9613498266Sopenharmony_ciAccept: */*
9713498266Sopenharmony_ciContent-Length: 78
9813498266Sopenharmony_ci
9913498266Sopenharmony_ciWeird
10013498266Sopenharmony_ci     file
10113498266Sopenharmony_ci         to
10213498266Sopenharmony_ci   upload
10313498266Sopenharmony_cifor
10413498266Sopenharmony_ci   testing
10513498266Sopenharmony_cithe
10613498266Sopenharmony_ci   PUT
10713498266Sopenharmony_ci      feature
10813498266Sopenharmony_ci</protocol>
10913498266Sopenharmony_ci</verify>
11013498266Sopenharmony_ci</testcase>
111