Skip to content

Decoding Base64 json responses #3254

Answered by jcamiel
riteshnoronha asked this question in Q&A
Discussion options

You must be logged in to vote

Just revisiting this issue, you can chain filters and decodes from base 64 then chain with a JSONPath filter:

GET http://foo.com/toto.bin
HTTP 200
[Asserts]
body base64Decode decode "utf-8" jsonpath "$.name" == "toto"

The different "steps" of the chains are applied from left to right:

  • body get HTTP response bytes and decodes it to a string
  • base64Decode decodes the string to bytes
  • decode "utf-8": decodes bytes to string using "utf-8" encoding
  • jsonpath "$.name" apply a JSONPath query to a JSON

base64Decode is available from Hurl 6.1.0

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@riteshnoronha
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by jcamiel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants