Skip to content

Saved requests on disk: .http format, 1 file = 1 request, dirs as groups #11

@syncended

Description

@syncended

Goal

Persist user-authored requests on disk in a human-readable, hand-editable, review-friendly format. Format follows the IntelliJ HTTP Client / VSCode REST Client conventions so users can also open the directory in IDEA and edit with syntax highlighting.

Scope

  • File format: .http (one request per file).
  • Directory structure: nested directories act as groups, e.g.
    <storage.path>/requests/
      github/
        list-repos.http
        create-issue.http
      internal/
        auth/
          login.http
    
  • Parser: stream-based, ~simple grammar.
    • Optional ### <title> separator at top.
    • Metadata via # @key value comments (e.g. # @name, # @timeout 5s, # @no-redirect).
    • Request line: <METHOD> <URL> — accept any uppercase token as METHOD (forward-compat for gRPC in v0.2, see #TBD).
    • Headers until first blank line.
    • Body after blank line, raw bytes/text. Detect form/multipart by Content-Type.
  • Writer: round-trip-safe (parse → write → parse yields the same model).
  • Repository API in :core:
    • RequestRepository.list(path) — recursive scan returning grouped tree.
    • RequestRepository.load(path) / save(path, request).
  • Stream/multi-message support (=== separator) is explicitly out of scope here — reserved for the gRPC v0.2 feature.

Out of scope

Acceptance criteria

  • A .http file authored by hand (or generated by IntelliJ) round-trips through the parser/writer without loss.
  • Saved requests can be listed, loaded, and saved by RequestRepository.
  • Parser tolerates and preserves # @key value metadata for forward-compat.
  • Unit tests cover: GET with headers, POST JSON body, POST form-urlencoded, POST multipart with file, metadata comments, nested directories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions