Skip to content
Advertisement

Tag: http

save response of http request on variable and extract it from the function on node.js

just need to console.log output in a variable (let body on my code) rather than in the console, and res.send (“body” not “data” that send now) this variable on angular/postman where make the request as a response. if i console.log(body: ${body}) inside the function, give the same result on terminal as process.stdout.write(d). So my problem is how to extract the

HttpOnly cookie is set only after the second request

I have a server (Node.js + Nest.js) and a client (Angular 11). The client submits a login request and the server logs in the user and sets a HttpOnly cookie in the response. The wierd thing is that the cookie is set in the browser only after submitting 2 requests, then it works fine (If i use postman for example,

Protocol version from JavaScript Fetch responses

I was just playing with Fetch and noticed it seemed impossible to get the protocol version from the response start line. During an HTTP request the first line of a response could look like this: HTTP/1.1 404 Not Found Basically, I am looking for a way to get the HTTP/1.1 part of the first line. I was able to find

Obtain result of GET request in javascript (and Node.js)

I am trying to get a rudimentary GET request from a Node.js server when I click on a button. server.js client.js However, the console log shows: How can I get my “foobarbaz”? If I go to localhost:8080/clicks the text shows up there. Additionally, the response already seems to be a javascript object — response.json() doesn’t work. Answer The send() parameter

400 BAD REQUEST when POST using Axios in React

Can any help me with this? I keep getting a 400 bad request from Axios. I can pass a GET request and confirm its working fine. I create http-common.js file with following code: Then,I create a service that uses axios object above to send HTTP requests. TodoService.js Then, I use TodoDataService.create(data) … in AddTodos component. AddTodos.js When clicked Submit it’s

Javascript / Three.js is not working in https

I recently switched my http site to https. Since I made this change, one of my projects no longer works. In this random generator, the background using the Three.js library does not appear when the url is in https But in http , it works beautiful and well. Does anyone know any solution to this problem? Thank you for your

How is Outlook Online downloading attachments?

I’m trying to understand how the “Download All” button works in Office365 Outlook Online when downloading multiple attachments from an email. The button is a “button” type. It does not appear to be part of a form. It has some “click” event listeners (apparently using React), but I’m not able to understand if those are somehow resulting in the download

Advertisement