Second request not receive json data
minwookH opened this issue · comments
Heo Minwook commented
I used
let loop = try! SelectorEventLoop(selector: try! KqueueSelector())
let router = Router()
let server = DefaultHTTPServer(eventLoop: loop, port: 9090, app: router.app)
router["/first"] = JSONResponse(
...
) { environ -> Any in
let input = environ["swsgi.input"] as! SWSGIInput
JSONReader.read(input) { json in
CODE A
}
...
}
router["/second"] = JSONResponse(
...
) { environ -> Any in
let input = environ["swsgi.input"] as! SWSGIInput
JSONReader.read(input) { json in
CODE B
}
...
}
do {
try server.start()
loop.runForever()
} catch {
print("Unexpected error : \(error).")
}
First call "/first" api and Second call "/second" api from Safari browser.
It contains json data.
The first api call calls for CODE A
but The second call does not call for CODE B.
Chrome browser is not problem