RestFixtureFitTests.MultipleMultipartPostTests

Included page: .RestFixtureFitTests.SetUp (edit)

Action Fixture
start smartrics.rest.test.fitnesse.fixture.HttpServerFixture
check is started true
press reset resources database


Ability to POST multipart entities

Multiple file uploads

Multiple multipart uploads

The method available up to version 4.1 and based on ```setMultipartFileName/setMultipartFileParameterName``` is deprecated.

Fit Rest Fixture http://localhost:7654
comment the content type header is recognised by the remote server to parse the uploaded content
setHeader Content-Type: multipart/form-data
addMultipartFile src/test/resources/MultipleMultipartTests/resource2.json jsonfile
addMultipartFile src/test/resources/MultipleMultipartTests/resource1.xml xmlfile application/xml
addMultipartString {
    "resource": {
    "name": "Bob",
    "data": "Bobs data"
    }
}
json application/json
comment In this case the backend server just echoes back the multiple multipart uploaded content for demo purposes
POST /resources 200 Content-Type : text/plain; charset=ISO-8859-1
Transfer-Encoding : chunked
Server : Jetty(6.0.2)
--UwPJN37OZ5_mA1BxkI78PaFt4YJC__Gu
Content-Disposition: form-data; name="jsonfile"; filename="resource2.json"
Content-Type: application/octet-stream; charset=ISO-8859-1
Content-Transfer-Encoding: binary

{
  "resource": {
    "name": "Bob",
    "data": "Bobs data"
  }
}
--UwPJN37OZ5_mA1BxkI78PaFt4YJC__Gu
Content-Disposition: form-data; name="xmlfile"; filename="resource1.xml"
Content-Type: application/xml; charset=ISO-8859-1
Content-Transfer-Encoding: binary

<resource>
    <name>Fizz name</name>
    <data>Buzz data</data>
</resource>
--UwPJN37OZ5_mA1BxkI78PaFt4YJC__Gu
Content-Disposition: form-data; name="json"
Content-Type: application/json; charset=US-ASCII
Content-Transfer-Encoding: 8bit

{
    "resource": {
    "name": "Bob",
    "data": "Bobs data"
    }
}
--UwPJN37OZ5_mA1BxkI78PaFt4YJC__Gu--