Skip to content

Add HTTP module (like httpx)#165

Open
hadashiA wants to merge 2 commits into
mainfrom
ku/http
Open

Add HTTP module (like httpx)#165
hadashiA wants to merge 2 commits into
mainfrom
ku/http

Conversation

@hadashiA
Copy link
Copy Markdown
Owner

No description provided.

JSON.parse / JSON.generate / JSON.pretty_generate / JSON.dump / JSON.load
backed by System.Text.Json's Utf8JsonReader/Utf8JsonWriter, plus #to_json
on the builtin scalar/collection types. Opt-in via MRubyState.DefineJson(),
matching the existing DefineRegexp / DefineHttp pattern.

HTTP integration: the previously-stubbed `json:` option now encodes via
JSON.generate (+ Content-Type: application/json), and HTTP::Response#json
parses the body lazily and caches the result. Both raise
NotImplementedError when JSON has not been loaded so the modules stay
independent.

Also rebuilds the existing sig/http*.rbs files (source path moved to
ChibiRuby; class-level summaries picked up by the newer rbs generator).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant