Skip to content

The second post JSON will result in 404 errors #15

@manyuanrong

Description

@manyuanrong

I started a server with the following code.

import { Application, Router } from "https://deno.land/x/oak/mod.ts";

async function server() {
  const app = new Application();
  const router = new Router();
  router.post("/json", async ctx => {
    ctx.response.body = "test";
  });
  app.use(router.routes());
  await app.listen(`0.0.0.0:5000`);
}
server();

But when I submit requests usingPOST and application/json. The first time I get the right response, however, all subsequent requests will get 404 errors

However, when I use curl access, it seems normal. It only happens on the browser and postman. I guess it's related to the reuse of connections.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions