Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Advanced response handling #1326

Open
dbarwikowski opened this issue Nov 15, 2024 · 0 comments
Open

Advanced response handling #1326

dbarwikowski opened this issue Nov 15, 2024 · 0 comments

Comments

@dbarwikowski
Copy link

Hello @Huachao. I want to thank you for this extension. It's very handy and powerful.

I want to ask you for new feature. It's easier to understand what I need if I describe what I am doing.

I'm testing API and in the response I get JSON with following structure:

{
  "name": "GDPR_Report.docx",
  "contentType": "application/vnd.openxmlformats-officedocument.wordprocessingml.document",
  "content": "..."
}

I then copy the content to powershell script and save it as file. It's a little bit inefficient.
If anyone find it useful - here is the script to save file:

$content = "..."
$filename = 'C:\Test\GDPR_Report.docx'

$bytes = [Convert]::FromBase64String($content)
[IO.File]::WriteAllBytes($filename, $bytes)

It would be nice if I could do something like this:

GET http://localhost:51574/v1/gdpr/123
Authorization: Bearer {{token}}
Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document
CorrelationId: test

>{%
    //something build in
    writeFile({{response.body.name}}, {{response.body.content}})
    
    //or any language support
    [IO.File]::WriteAllBytes({{response.body.name}}, {{response.body.content}}) //ps1
%}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant