Skip to content

Support using filters to construct request body #3990

@skeggse

Description

@skeggse

Problem to solve

I'm testing AWS endpoints (actually AWS Lambda functions), which sometimes desire JSON requests with an embedded base64 payload. Just writing out the request this way means that the .hurl file has some JSON with a big base64 blob in the middle, which isn't particularly easy to read.

Proposal

Since there's already filter support for base64Encode, it'd be great if I could use variable support in [Options] to encode my base64 and then embed it in the JSON as a template:

[Options]
variable: base64_data="test" base64Encode
```json
{
  "records": [
    {
      "message": {{base64_data}}
    }
  ]
}
```

to produce a request body of

{"records":[{"message":"dGVzdA=="}]}

Additional context and resources

Tasks to complete

  • ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions