03 From outside

  R=http://crosspoint.local
  
  # 1. enqueue
  curl -s -X POST $R/api/plugin-jobs \
    -d '{"plugin":"my-plugin","action":"save-url","args":{"url":"https://example.com/b.epub","name":"b"}}'
  # -> {"id":7}
  
  # 2. make sure an executor page is open (once), e.g. in a browser tab or a hidden webview:
  #    http://crosspoint.local/plugins-run
  
  # 3. poll
  curl -s "$R/api/plugin-jobs/status?id=7"
  # -> {"id":7,"state":"pending","result":null}
  # -> {"id":7,"state":"running","result":null}
  # -> {"id":7,"state":"done","result":{"path":"/Books/Inbox/b.epub","bytes":48213}}

The POST body is raw JSON (no Content-Type needed, but sending application/json is fine).
‹ PreviousReader file (.txt)Next ›