Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagepy
import base64
import json

# Decode from Base64
context_str = base64.b64decode(response.headers['ContextBase64utf'])
# Load json from string
context = json.loads(context_str)

Context in body

When gettting getting an image in the response, by default the context is sent in headers. However, with a very large number of defects, the maximum header length limit can be reached. To solve this, you can use the option to send context in the body of the response together with the image and get the image length in a header 'ImageLen' to be able to divide the two parts after. To activate this mode, add the following to the request:

...