Skip to main content

Read a workspace file as base64

GET 

/session/files/content

Returns the full bytes of one regular file in the session's workspace, base64 encoded, so text and binary files read the same way. A symbolic link inside the workspace is followed to its target.

  • The file can be at most PEEN_MAX_FILE_API_BYTES bytes, 16 MiB by default. A larger file answers 400 VALIDATION_FAILED; there is no partial or ranged read.
  • A directory, device, socket or pipe answers 400 VALIDATION_FAILED.
  • The path follows the rules of GET /session/files. A session that does not exist answers 404 SESSION_NOT_FOUND, and a path that does not exist answers 404 NOT_FOUND.

Request​

Responses​

The file's bytes, base64 encoded.

Response Headers
    X-Session-ID

    The session this response belongs to. For session-scoped requests it echoes the X-Session-ID request header; for POST /sessions/open and POST /sessions/system it is the session that was opened or created.

    X-Request-ID

    The request's correlation ID. When the request carried an X-Request-ID header holding a UUID, Peen echoes it; otherwise Peen generates a new UUID. The controller log records the same value for this request.