Maintainers
Pricing
Enterprise
More
More
Documentation
Try Live
Rankings
Install
Blog
Docs7
Ask
New
Add Docs
Raw HTTP Response
https://github.com/wix-incubator/raw-http-response
Admin
A small package that generates a raw HTTP response from an object.
Tokens:
144
Snippets:
2
Trust Score:
9.4
License:
MIT
Update:
3 months ago
Context
Chat
Benchmark
Latest
Show doc for...
Code
Info
Show Results
Tokens:
Raw
Copy
Link
Tokens:
Raw
Copy
Link
### Generate Raw HTTP Response Source: https://github.com/wix-incubator/raw-http-response/blob/master/README.md Use this snippet to generate a raw HTTP response buffer. Ensure you import the 'raw-http-response' package and provide a valid RawResponse object. ```typescript import buildHttpResponse from 'raw-http-response'; const buffer = buildHttpResponse({ status: 200, headers: { "Content-Type": "application/json" }, body: Buffer.from( JSON.stringify({ hello: "world" }) ) }); ```