How to monitor node http requests in node-webkit - node-webkit

How can I monitor http requests that were made by node in node-webkit? When I make a request I don't see it in the developer tools. I can see the request only when I make it with jquery or xmlhttprequest.
I've binded a console.log on the 'end' event and I can see that node-webkit is actually doing the request and it's returning me a correct response. But doing this blind requests is very hard because there is absolutely no way to debug them (except for logging the params that I've called the request method with).

Such low-level procedures can only be handled by the supported node.js so one of these node.js functions is bound to solve your HTTP header monitoring problem:
https://nodejs.org/dist/latest-v6.x/docs/api/http.html#http_event_checkexpectation

Related

Does TestCafe RequestMock Stop the Original Request

When implementing a RequestMock in TestCafe does the original request still get made and completed and then modified by TestCafe or does TestCafe intercept the request and stop the original?
I'm asking because we are thinking about using this feature to mock some requests to speed up testing, such as mocking images. However, if the original request still has to be completed before the mock then this does not seem like a viable solution.
RequestMock intercepts requests to a web resource and emulates a response, so the original request is not performed. Please refer to the documentation for more information.

Safari Web Inspector: What is the difference between request and response local overrides?

I am trying to read the docs on Safari Inspector's Local Overrides here. It talks about Request and Response overrides, but I am not understanding the difference between the two.
I am trying to make edit a request to make it send a different value than what's currently being send. Is it possible with request overrides?

Ktor: first call.receiveText() gets timeout

I’ve recently developed a simple Ktor app and organized a hosting for it on Apache Webserver + Tomcat.
The app has post { … } route used for processing HTTP POST requests. The route works fine for all requests except the first one.
Some additional tracing shows that request processing stucks on the line
call.receiveText()
where I read the POST JSON body for further parsing. The request is stuck until network timeout, and I couldn’t detect the actual processing time (it takes minutes).
Every following POST request with exactly the same content is processed fine. In Tomcat settings I put “load-on-startup” - it didn’t affect the result.
What could be the reason of such behavior? I assume some lazy loading issue. Does Ktor provide some mechanism to force initialization of the library components?

Getting HTTP protocol version from response headers in Vue.js with vue-resource

I’m trying to get and print the HTTP protocol version of the target in requests made by vue-resource in a Vue.js component. I don’t have any problem in getting headers like Data or Server: being on localhost I use a proxy to bypass the CORS limitations as well, but I can’t figure out how to do the same with that. As far as I know, both Chrome and Firefox developer tools refer to the HTTP protocol version in the request (not in the response), so using response.headers.get("foo"); as explained in the official documentation doesn’t work, and I don’t have a request variable set. I just need to show if the target uses HTTP 1.x or 2.x in a string like HTTP/1.1 200 OK — I can’t understand if Vue.http.interceptors could help and how. I guess it shouldn’t be that hard… thanks in advance!
EDIT: Unrelated to Vue.js itself, but resource.nextHopProtocol did the trick — on Firefox, at least. Being a Candidate Recommendation, it doesn’t work with all the browsers.

Are there any samples/tutorials which tells how to call servlets on J2EE server from iPhone app?

Sorry for posting basic question but please give me your advise.
I have to write iOS application which communicates with web application deployed on Tomcat server.
The web application requires client-app to call the "logon" servlet with username and password to get JSESSIONID. Once client get JSESSIONID, the web application allows to invoke other servlets.
But I couldn't figure out how to manage the session to invoke these servlets.
Would you please introduce me the examples/tutorials to learn how to invoke these kind of servlets?
Thank you in advance.
Here's a decent example of making an http request from iOS:
iOS: How to make a secure HTTPS connection to pass credentials?
There's nothing magic about making the call to a j2ee tomcat server - it's just an HTTP request, so any way you can make an HTTP request will work for you.
Maybe this one too:
Can I make POST or GET requests from an iphone application?
edit: ahh, looks like this is the one you want:
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/URLLoadingSystem/Tasks/UsingNSURLConnection.html
The JSESSIONID is nothing special. If your application is set up to handle cookies coming back from your HTTP request then the JSESSIONID will come back as a cookie in the header. Otherwise you will be issued a redirect to a URL with the JSESSIONID in it. From there, if you handle cookies, the JSESSIONID will be passed automatically with each request with all of the other cookies. Otherwise you'll have to put it into the URL of each request manually.
Download the liveheaders plugin for Firefox and try hitting your servlet with the webbrowser and you can see how the JSESSIONID gets passed around. Next, turn off cookies in Firefox and you can see how it's passed around in the URL and you can see the redirect that Tomcat issues if you watch the headers in liveheaders.