2016-09-16 42 views

回答

2

有4種類型的HTTP post方法由「Content-Type」頭指定。通常內容類型值是「application/x-www-form-urlencoded」,請求主體的內容就像

name=nameValue&age=10 

但是你需要的格式就像JSON.So也許JSON型POST能夠滿足您need.Just設置Content-Type頭爲「application/JSON」,並請求主體的內容就像是

{"name":"name","age":10} 

和用於放心的方式可以參考這個問題setting content type in rest assured

參考application/x-www-form-urlencoded or multipart/form-data?