spinframework / spinframework/spin-rust-sdk

P3 Request body seems unexpected

Open
#99 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
35
Forks
23
Avg merge
37m
Merged PRs (30d)
1

Description

I am writing a P3 handler using spin_sdk::http_wasip3::Request (not the IncomingRequest type used in the P3 double-echo example).

When I use the .body() method, I get a... thing... (&IncomingBody<Request>) which does not seem to let me access the body, but does let me access, say, the headers:

Image

How do I get a body out of an IncomingBody<Request>? My specific interest is in processing the streaming body so I'm ultimately looking for a Stream or AsyncRead or something like that.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing spin_sdk::http_wasip3::Request with the P3 double-echo example's IncomingRequest, then inspect the IncomingBody API returned by body(). Done means identifying a supported way to process the request body as a stream or AsyncRead, or defining the SDK support needed for that access.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
api
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.