Forum Discussion

mchiang's avatar
mchiang
New Contributor
8 years ago
Solved

Convert curl request to SoapUI Request

I'm currently trying to convert a working curl command to a valid SoapUI test case but am having some issues. I am trying to attach a json file and the server also requires authorisation. I'm able to...
  • mchiang's avatar
    mchiang
    8 years ago

    The workaround to perform is to remove the name via Groovy.  You can change it by using the below Groovy script in event handler FilterRequest.filterRequest:

     

    def bodyPart1 = context.getProperty("httpMethod").requestEntity.message.content.getBodyPart(0)

     

    bodyPart1.removeHeader("Content-Type")

    bodyPart1.addHeader("Content-Type","application/json")