RestFixtureTests.MultipleMultipartPostTests

Included page: .RestFixtureTests.SetUp (edit)

script smartrics.rest.test.fitnesse.fixture.HttpServerFixture
check is started true
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.

Table: Rest Fixture http://localhost:9876
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
200
Content-Type : text/plain; charset=ISO-8859-1
Transfer-Encoding : chunked
Server : Jetty(6.0.2)
--oGUHbgeNlD4Ly0nYrqr4wI294f5oL5DVrJN
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"
  }
}
--oGUHbgeNlD4Ly0nYrqr4wI294f5oL5DVrJN
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>
--oGUHbgeNlD4Ly0nYrqr4wI294f5oL5DVrJN
Content-Disposition: form-data; name="json"
Content-Type: application/json; charset=US-ASCII
Content-Transfer-Encoding: 8bit

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

--oGUHbgeNlD4Ly0nYrqr4wI294f5oL5DVrJN--