HsacAcceptanceTests.SlimTests.HttpTest.HttpFileUploadTest


script file fixture
$createdFile<-[upload.txt] create upload.txt containing This is a file to test the file upload

Upload file with POST HTTP method


script mock xml server setup
add response
<binary/>
$url<-[http://127.0.0.1:8000/FitNesseMock] get mock server url

script http test
post file $createdFile->[upload.txt] to $url->[http://127.0.0.1:8000/FitNesseMock]

table: Mock Server Message Report
Expected and received 1 requests
1

request

--YqQc9etERDZzEgH7HVgQFtNzk7KHZKM Content-Disposition: form-data; name="file"; filename="upload.txt" Content-Type: application/octet-stream Content-Transfer-Encoding: binary This is a file to test the file upload --YqQc9etERDZzEgH7HVgQFtNzk7KHZKM--

response

<binary/>

script mock xml server setup
stop

Upload file with PUT HTTP method


script mock xml server setup
add response
<binary/>
$url<-[http://127.0.0.1:8000/FitNesseMock] get mock server url

script http test
put file $createdFile->[upload.txt] to $url->[http://127.0.0.1:8000/FitNesseMock]

table: Mock Server Message Report
Expected and received 1 requests
1

request

--Dl8sdiHhNkW_JVyODQxgUh9FoxdxnYP1eT Content-Disposition: form-data; name="file"; filename="upload.txt" Content-Type: application/octet-stream Content-Transfer-Encoding: binary This is a file to test the file upload --Dl8sdiHhNkW_JVyODQxgUh9FoxdxnYP1eT--

response

<binary/>

script mock xml server setup
stop