API not working in ReadyAPI though it works in swagger or Postman
Hello,
I have a problem with requests I imported from swagger.
I have a request that looks like /m2m/fim/items?filter=(tags=DEVICE)&exclude=tags,objectClass,href,operations,attributes,metadata,factory&expand=properties&limit=20
With swagger I can test it, if I import it in Postman, it works as well. it gives me the current request:
My SOAP request looks like
"GET /m2m/fim/items?filter=%28tags%3DDEVICE%29&exclude=tags%2CobjectClass%2Chref%2Coperations%2Cattributes%2Cmetadata%2Cfactory&expand=properties&limit=20 HTTP/1.1[\r][\n]"
It looks like parenthesis are converted for the request (which does not happen with Postman), then my request fails.
Can anyone tell me which syntax I can use so that the parenthesis will not be interpreted ?
EDIT :
I realized that I have a header, Accept-encoding, which is set to 'gzip, deflate' in my HTTP log, however in Postman, the header is Accept:application/json.
I can't find where to update this, do someone know this ?
thank you
Alex
well, finally I executed the following groovy script :
import com.eviware.soapui.support.types.StringToStringMap
testRunner.testCase.testSuite.project.testSuites.each
{
suite ->
suite.getValue().testCases.each
{
q1->
q1.getValue().testSteps.each
{
it->
if (it.getValue().config.type.equals("restrequest"))
{
//Get the headers of the current teststep
def headers = it.getValue().getHttpRequest().getRequestHeaders()
//log.info "headers = " + headers
def list = []
//Append the new header to the existing list
list.add("application/json")
log.info "list = " + list
headers["Accept"] = list;
//Set the updated header list
it.getValue().getHttpRequest().setRequestHeaders(headers)
}
}
}
}