Reputation: 8878
I have a node.js+express+mongo DB app where,
app.get('/test/:testString', function (req, res) {
console.log('req.params.testString: %s ', req.params.testString);
... insert to a collection....
from my client side, I fired two http get almost at the same time. I thought there should be two console.log print out for these two requests. However, strangely, only the second request's log shows and only the second request goes thru the collection insertion. On my server side terminal, I can see two http get requests arrived. Any idea?
Regards Hammer
More:@CFrei @ Peter
I think I know the cause. I have http://www.google.com in my testString. If I remove '//' and '/', then I can see the log printed out. I have already used NSUTF8StringEncoding in my native firing of http get. Any special handling need to be added on express side?
Upvotes: 0
Views: 258
Reputation: 146014
If the client is a browser my first guess would be browser connection management interfering. Try using curl
on the command line instead to test.
Upvotes: 1