Reputation: 1677
I want to send a HTTP POST request with Content-Type : Multipart/mixed using FitNesse . I need a solution only using Fitnesse Tool http://fitnesse.org/ as it is required for my project. Any help/guidance would be great.
Upvotes: 0
Views: 1199
Reputation: 1458
Just wrote a fitnesse fixture for multipart mixed content types.
The already existing smartrics rest fixtures can handle only multipart/form-data NOT multipart/mixed
.
It is also strange that the Httpcomponent 3.2 does not support multipart/mixed, but only multipart/form-data. Worse enough, I see no documentation that it does not support multipart/mixed. It is only on going through the source code, that I could see that the 'multipart/form-data' content type is hard-coded all over the place.
My fixture is written using :
Http component 4.3 : I have added additional support for multipart/mixed, apart from the already existing multipart/form-data
.
Smartrics rest fixutre 3.0 : Extended the already existing restfixture class and the partfactory class to support multipart/mixed
.
Download the fixture from : https://code.google.com/p/multipart-rest-fitnesse-fixture/
Sample fitnesse Request to illustrate the usage: http://geekoolympics.blogspot.in/2014/01/multipart-fitnesse-fixture-for-restful.html
Upvotes: 1
Reputation: 2569
FitNesse itself cannot do what you want. You will need a fixture that does the work of the multipart upload.
You can take a look at https://github.com/smartrics/RestFixture/wiki and see if it matches your needs.
If not, you will have to write your own fixture class. HttpClient is a pretty powerful and usable class to build something like this with. Unfortunately, I cannot provide a working example as a reference.
Upvotes: 1