rest-assured


how to set contentdisposition header using restassured


i am using multipart to automate of of the web service.
along with the request body i passed following :
Response response2 =
given().
config(RestAssured.config().sslConfig(new SSLConfig().relaxedHTTPSValidation())).
multiPart("test1", new File(System.getProperty("user.dir")+"\\src\\ExcelFiles\\test1.pdf")).
header("SM_USER","BR86609").header("applicationId","163500").
contentType("multipart/mixed").
body("{\"productName\": \"WS_prodCreated_wsAuto\",\"productType\":\"SN\",\"issuerProvider\":\"BANKO BANCOMER\",\"issueDate\":1421756467944,“tipSheetCount”:2"
+ "\"tipSheets\": [{\"fileName\":\"test.xlsx\",\"comments\":\"Comments 1\",\"version\":\"DRAFT\"},{\"fileName\":\"test1.pdf\",\"comments\":\"Comments 1\",\"version\":\"FINAL\"}],"
+ "\"distributionList\":[\"bodempudi.rao#citi.com\",\"user#citi.com\"],\"genericProduct\": false,\"productScope\": [\"India\",\"US\"]}").
when().
post("https://vm-5aeb-7dd1.nam.nsroot.net:18121/IPRRatingWebServiceClone3/rest/create/product").
then().
extract().response();
After running this request i get following responce :
Tipsheet file test1.pdf does not sends the size parameter as a part of the contentdisposition header
So the question here is .. how to pass "contentdisposition header" with req. body using restassured.
My intention here is to pass the file size as weel with the request.
Try adding content-disposition as follows
.header("Content-Disposition", "attachment; filename=test1.pdf")

Related Links

Rest-Assured validate each item in a JSON array
How to find specific entry in array response?
Restassured “OR” condition
RestAssured Automation - Unable to find the exact jar file to import
Can RestAssured handle session IDs within headers other than the standard “Set-Cookie” header?
how to set contentdisposition header using restassured
Getting Error When Trying Using Rest Assured on Serenity BDD
Rest Assured - java.lang.NoSuchFieldError: DEF_CONTENT_CHARSET
RestAssured test hateoas
Getting 'NoClassDefFoundError' (com/../JsonSchemaFactory) when trying to validate schema in Rest-Assured tool
“Invalid number of path parameters. Expected 0, was 3” error while passing the url parameters in rest api (rest-assured)
How do you send XML post request using rest-assured?
Extracting value of a node in Java using contains with JsonPath in RestAssured
In Rest-assured, how to set XSRF token and Authorization values for post call
What is the language that Rest Assured can work with
Rest Assured Body handling ArrayList

Categories

HOME
php
oracle
mod-rewrite
jms
key
operating-system
filesize
openlayers-3
mongoid
ipv6
sharepoint-online
phpstorm-2017.1
mailmerge
google-tasks-api
asciimath
boomi
adobe-illustrator
libgit2
anova
weex
maven-surefire-plugin
qa
rxjs5
intel
channel
restier
list-comprehension
netbios
private-key
adminer
creation
bean-validation
db2-luw
numerics
mv
hidden-markov-models
microkernel
game-center
oauth2-playground
httphandler
expandablelistview
react-intl
liteide
return-type
non-linear-regression
watir-webdriver
sesame
alertify
business-rules
boost-compute
e
clp
android-4.2-jelly-bean
deferred-rendering
node-glob
i2b2
ioctl
ajax4jsf
pythonxy
extend
supersocket.net
vdm-sl
componentart
tidyr
findersync
jcheckbox
rebar
visual-c++-2012
category-theory
jini
forceclose
thruway
xulrunner
autonumber
django-settings
application-blocks
mute
codahale-metrics
node.js-stream
chartfx
semicolon
background-thread
chefspec
2d-vector
user-forums
idispatch
struts2-json-plugin
zend-pdf
clrprofiler
clearinterval
yuidoc
upshot
qcar-sdk
pyjamas
odac
cleartype
ppc
projectpier
ning
levels
error-detection

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App