/Wiki/sources/honojs__hono/2026/https-hono-dev-llms-full-txt-request-and-respons-0be913dc4750-request-and-response-s0098-c0002.md
Request and Response (3) - hono-docs
Request and Response (3) Source evidence: /Sources/raw/honojs hono/honojs hono.md Canonical citation: https://hono.dev/llms full.txt request and response Sum...
Request and Response (3)
Source evidence: /Sources/raw/honojshono/honojshono.md Canonical citation: https://hono.dev/llms-full.txt#request-and-response
Summary
To make a request to POST /posts with JSON data, do the following. ```ts test('POST /posts', async () => { const res = await app.request('/posts', { method: 'POST', body: JSON.stringify({ message: 'hello hono' }), headers: new Header...
Content
To make a request to POST /posts with JSON data, do the following.
test('POST /posts', async () => {
const res = await app.request('/posts', {
method: 'POST',
body: JSON.stringify({ message: 'hello hono' }),
headers: new Headers({ 'Content-Type': 'application/json' }),
})
expect(res.status).toBe(201)
expect(res.headers.get('X-Custom')).toBe('Thank you')
expect(await res.json()).toEqual({
message: 'Created',
})
})To make a request to POST /posts with multipart/form-data data, do the following.