Forum Discussion

erarunmishra9's avatar
erarunmishra9
New Contributor
4 years ago

save image from api response to file groovy

hi,

i am new to groovy and my requirement is to save API response to image file  with groovy script.

i checked with previous thread but it's not working.

Can somebody please share groovy code with required import groovy classes.

it will be very helpful,

thanks in advance.

5 Replies

  • richie's avatar
    richie
    Community Hero
    Hey erarunmishra9

    According to the help you dont need to rely on groovy for this.
    Is this for a REST step or SOAP request?
    As long as this is REST, according to the help you can use the 'Dump file' atteibute within your request attributes to save a requests response including any associated file attachments.

    Cheers,

    Rich
    • erarunmishra9's avatar
      erarunmishra9
      New Contributor

      hi Richie,

      this is a REST response and i have to this in groovy.

      • erarunmishra9's avatar
        erarunmishra9
        New Contributor

        is it feasible in groovy to save REST API image response in .jpg/.png file?

        if yes please suggest additional classes also.