Is it possible to send multiple res.send/json in the same method? I am facing a challenge as I want to create a function within a Web-Worker to make a put request every minute. However, on the second request, I receive an error message "can't set headers a ...
Greetings everyone, I am new to Perl but have some experience with other programming languages. Recently, I created a simple code that retrieves a JSON file from the internet for a Telegram bot. However, when I display the data, everything seems fine. But ...
Here is the script I wrote to scrape data from multiple pages using request and cheerio modules: for (let j = 1; j < nbRequest; j++) { const currentPromise = new Promise((resolve, reject) => { request( `https://www.url${j}`, (error ...
There is a specific portion of code in my application that requires redirection under certain conditions while continuing with the normal flow if those conditions are not met: # Trigger point for the request def MyView(request): object = MyAuth(request) ...
I am currently utilizing passportJS for managing login and persistent sessions on the server backend. While everything functions properly when sending requests from the server frontend (a webpage that I didn't create and lack sufficient knowledge to ...
Currently, I am analyzing the logs of the application to provide you with important information regarding the two different strategies implemented within the system. POST Process PRE Process Under the first strategy, if the application needs to make a c ...
While I am able to retrieve pageviews info for other pages, I'm encountering an error when trying to fetch data from a particular page. The error message reads: File "<unknown>", line 1 article =='L'amica_geniale_ (serie_di_romanzi ...
I have encountered an issue that I need assistance with: My goal is to retrieve a static file from a different server and return it to the user with an altered content-type header. The code below successfully achieves this, but I am struggling to find a ...
Big shoutout to the amazing individuals who have provided assistance on another thread: Retrieve final word from URL following a forward slash in PHP Now, I am encountering a new dilemma. How can I accomplish this task in PHP: If $last_word also contai ...
Utilizing the request module for handling HTTP requests in Node.js has proven to be quite handy. Here's a snippet of code showcasing its usage: module.exports.getToken = function(){ var token ; request(validLoginRequest, function(err,resp,b ...
I've encountered an issue where I send a request to a page and upon receiving the response, which is a string, something goes wrong. Here is the code for the request : jQuery.ajax({ url:'../admin/parsers/check_address.php', meth ...
My goal is to retrieve the HTML content of a JavaScript-generated website so that I can extract information using BeautifulSoup. However, when I attempt to request the HTML, the data I receive is from before the page fully loads. Below is the code snippet ...
Every time I attempt to update a record, instead of updating the objects, they get deleted. Even though my routes seem correct and it's functioning fine in Postman. Routes: router.route('/update/:id').post(function (req, res) { Bet.findById({ _id: req.pa ...
I am in need of a solution to download files from the server using nodejs. Here is the code snippet I currently have for downloading the file. test.js function downloadFile() { var fsModule = 'fs'; var fs = require(fsModule); var reque ...
Struggling with uploading a file to Autodesk using the View and Data API, I am having trouble figuring out how to send curl by http or request lib. Specifically, I'm unsure of how to set the expect header. Below is the curl command I have been trying ...
I have developed a web scraping Node.js application that extracts job description text from multiple URLs. Currently, I am working with an array of job objects called jobObj. The code iterates through each URL, sends a request for HTML content, uses the Ch ...
Attempting to save images stored in a web-space account can be challenging. Accessing the private space with credentials and retrieving the image link using Puppeteer works smoothly. However, when the src attribute of the image includes additional authenti ...
I am facing an issue with my small react client and express server setup. The react client runs on port 3000 while the express server runs on port 3001. Whenever I click a button, a request is sent to the server. However, the POST request seems to print an ...
I'm currently running a frontend website (ejs and node/express) on localhost:8000, while the backend server (node/express) is running on localhost:8010. My database is located in the backend server. I have successfully implemented Social login (fb, google ...
I am having trouble passing the get request answer to the post request. Can someone assist me, please? var app = require('express')(); var http = require('http').Server(app); var bodyParser = require('body-parser'); var reque ...
Recently, I embarked on a project using Sailsjs with DynamoDB as the database. During my research, I came across a helpful package at https://github.com/dohzoh/sails-dynamodb. The documentation provided detailed instructions for the initial setup. After i ...
When I'm using the request library to parse data, it returns a list of JSON data. However, when I try to find the length of the response list, I encounter an error that states TypeError: object of type 'Response' has no len(). Here is the code snippet I am ...
I have been developing a web crawler that is capable of retrieving and parsing data, then storing it in my MySQL database. While I have succeeded in storing the results, I am facing an issue when attempting to end the connection. The technologies I am usi ...
I am having trouble sending a response after making a request to the API. Here is my code: app.post('/auth/login', (req, res, next) => { if (req.body.login && req.body.password) { var options = { method: 'POST&ap ...
I am looking to incorporate a real-time COVID-19 total cases tracker for Russia on my website. In order to achieve this, I am sending a request to using the following script: function httpGet(theUrl) { var xmlHttp = new XMLHttpRequest(); xmlHttp.o ...
I've started working on two separate projects - one using Vue.js (created with vue create project_name) and the other using Laravel (created with laravel new project_name). My goal now is to transfer data from the Vue.js project to the Laravel project ...
I'm in the process of learning how to use Express, and within my application I have implemented middleware that transfers the session object from the Request to the Response. This allows me to access it in my views: app.use((req, res, next) -> res.lo ...
I'm experiencing an issue with the post method. Whenever I try to retrieve data using the segmentService, I always receive an empty segmentdata object in my temporarySegment variable. Strangely enough, when I use the same approach for retrieving numbers, i ...
My get route is set up to receive two parameters "limit" and "page". router.get('/:limit/:page', userController.list); class UserController{ public list(req:Request, res:Response): void{ const limit:number = +req.params.limit || 25; ...
Is there a way to pass a function as a request header using the NPM request module's request.defaults API? I want the function's result to become the header value every time I make an outgoing request. For example: request.defaults({ headers: { dates ...
I'm currently working with an API that requires sending a callback to a specific URL. I have configured my URL and view as follows: def get_callback(request): ... some processing with request.body Despite setting up the view, when I check the req ...
I can't figure out why I keep receiving the status code 403 when running this code. My objective is to authenticate with Instagram. var request = require("request"); var options = { url:'https://www.instagram.com/accounts/login/', auth: { ...
Looking for guidance on retrieving ClientID and secret from my Nodejs server? Here's an example post: Request example: curl --request POST \ --url https://api.opskins.com/IOAuth/CreateClient/v1/ \ --header 'authorization: Basic {{ ...
Within the realm of node js, I discovered that the Socket Timeout default setting is Two Minutes, as stipulated in the documentation. In order to make modifications, I am seeking the specific location within the package where this code resides. Although I ...
I have a collection of available job listings stored in my temporary variable. I am interested in extracting specific text from these listings individually. How can I retrieve text from nested classes? In the provided code snippet, I encountered empty lin ...
I am trying to make an HTTP request that returns the data in JSON format using 'JSON.stringify(data)'. var xhr = new XMLHttpRequest(); xhr.open("GET", "/api/hello", true); xhr.send(); xhr.onreadystatechange = function () { console.log(xhr.r ...
Below is the code snippet I have: import base64 import requests import json import csv USERNAME, PASSWORD = 'Username', 'Password' req = requests.get( url="https://api.mysportsfeeds.com/v1.1/pull/nhl/2017-2018-regular/game_startinglineup.json?gameid= ...
I am facing a challenge when it comes to sending and receiving query parameters using express and request. On the request side: const request = require('request'); request({url: 'http://localhost', json: true, qs: {id: [1,2,3,4]}}) T ...
I am currently in the process of learning how to use REST APIs for GitHub, and my current project involves creating a new repository using JavaScript. Below is the function I have written for this purpose, which includes generating a token and granting all ...
Currently, I am in the process of developing an Angular application and encountering some challenges while implementing a retry mechanism for the latest request within an HTTP interceptor. The interceptor is primarily used for authentication validation on ...
I am attempting to make a request to route.ts located at /api/register from the client component register.js. Even though the user is registered in the database, I keep receiving this error message. Here is my route.ts function: export async function POST ...
I attempted to send a message to Telegram using Python while running the code on Heroku. I utilized the import request library for this task. The message was successfully sent, but I encountered an issue with Heroku: Traceback (most recent call last): 202 ...
Hi there, I'm currently getting started with Angular and I am eager to create a login feature. However, I am unsure of how to send a login request. Despite my efforts to find similar inquiries, the only information available pertains to older question ...
Welcome to the community of inquisitive individuals on Stack! I'm facing an interesting challenge while developing an Express app. Despite everything running smoothly with two routes, I've hit a roadblock with one route that seems to have empty incoming ...
When using the npm module request, I often encounter situations where some requests are not called back, leading to various issues. This has raised a question in my mind - is it expected for the request function to always callback? For instance, if my req ...
We have encountered a peculiar problem while trying to download and decompress a large file of approximately 6 GB (which decompresses to around 64 GB) using the HTTP protocol. To achieve this, we are utilizing either Node.js' request library or axios. The ...
Trying to initiate a broadcast through my Facebook Messenger bot, I have implemented the following code: if (subscribe === true) { // Initiate HTTP request to Messenger Platform request({ "uri": "https://graph.facebook.com/v2.11/me/broadcast_messa ...
For my request, I need to send a batch of 40 items with a 10-second break between each batch. After updating the parameters, when I run the following code: const request = require('request'); let options = { 'method': 'POST', 'url': 'https://mysite.com ...
Hi, I am still a beginner when it comes to NodeJS and its modules. I could really use some assistance with creating a progress bar for an application I'm working on. Right now, the progress bar only reaches 100% upon completion and I suspect my piping tech ...
I need to direct admins to /admin and members to /member when they are logged in and try to access the home page (/). The controller function for this logic is shown below: public function indexAction() { if ($this->get('security.context&apos ...
Whenever I attempt to authorize, it goes through without any issues. However, I am unable to obtain a token for subsequent requests (get, post). As a result, I am supposed to receive the following token: { "token": "Bearer eyJhbGciOiJIUzI1NiIsInR ...
Currently, I am utilizing Express along with Request to interact with an API. To maintain clean and organized route files, a few controller files use exports. module.exports = function(app){ var moment = require('moment'), request = require('requ ...
Having some trouble with an ajax function I developed for a small project. The issue lies in running the code inside the .done() function. This function is supposed to receive a json object from php (which I am obtaining a response via cURL), but it appear ...
I'm currently experimenting with the request module in NPM and encountering an issue where it returns undefined. I believe I am utilizing xml2js correctly, but could my misuse of the 'form' option in the request module be causing this proble ...
I am struggling with understanding the documentation and need to validate parameter data in order to determine if a user is allowed to access their login. I am also using Express, which is causing confusion for me when it comes to using expressApp.use() an ...
After diving into the world of NodeJS for the first time (so awesome!) and also getting acquainted with Express, I managed to get my web app/service up and running smoothly. However, things took a turn when attempting to handle multiple http requests. Here ...
Attempting to send a PUT request using the 'request' function to the following URL: request({ uri: 'http://apiurl.url/1.0/data?token=' + APItoken, method: 'PUT', data: [{ ...
I have a task that requires creating a nodejs script for two specific functions: Retrieve my public IP address. Update my public IP address on my freenom.com account for a registered domain. Currently, I have two separate scripts in place to accompl ...
Attempting to download a file using jQuery AJAX post request from ReactJs, with an express router middleware layer utilizing the Request API to send requests to a Spring Boot REST API. The flow goes like this: AJAX => Express POST route => Spring Boot API. ...
I am currently working on sending data to a Java back end running on a Tomcat server. Here is what I have attempted so far: I have already installed the request module and found that the GET method is functioning correctly. Router.post('/', function(req ...
Is it possible to determine the response status when making a JSONP request? For example, can you tell if the request was successful with a 200 OK status, or if the resource was not found with a 404 error code? Alternatively, is there a method to attempt ...
Node.js requires careful handling of POST requests, as the post data may arrive in chunks that need to be concatenated together. Here's an example of how this can be done: function handleRequest(request, response) { if (request.method == 'POST') { ...
var UfcAPI = require('ufc-api'); var ufc = new UfcAPI({ version: '3' }); const fighterIdList = []; function fetchFighterIds() { ufc.fighters(function(err, res) { for (let i = 0; i < res.body.length; i++) { ...
Today, I encountered a problem with express. Let's say we set multiple cookies, but when I check request.headers, only one cookie is returned: cookie: 'userSession=123' For instance, not only is it unreliable to use request.headers.cookie (since users ma ...
I'm attempting to make a POST request to Ghostbin using Node.JS and the request NPM module. Below is the code I have been utilizing: First Try: reqest.post({ url: "https://ghostbin.com/paste/new", text: "test post" }, function (err, res, body) { ...
I'm currently working on integrating the uClassify API into my Node project, but I'm encountering some issues with my code. Here's what I have so far: const req = JSON.stringify('Hello, my love!'); const options = { body: ...
After going through various posts, such as Similar Problem 1 and Similar Problem 2, I am still unable to find a solution that works for me. My JavaScript code is as follows: var xhttp = new XMLHttpRequest(); xhttp.open("GET", "react.php?do=getnotify& ...
Exploring the realm of handling JSON data from a web API is new to me. I'm eager to delve into its intricacies and understand how it operates. Despite my online research, I am still unclear about the process. As far as I know, the general procedure involv ...
After successfully making a request with querystring params, I encountered an issue while trying to promisify my request: // Works var Promise = require("bluebird"); var request = Promise.promisifyAll(require("request")); request.get({ url: 'htt ...
Could someone please help me with a perplexing issue I'm facing? I am working on a Node.js/Express setup and my goal is to retrieve the client IP address for each request to the site. Here is the code snippet I have written: const express = require('expres ...
I've been attempting to pass a middleware variable to my API pages via "req" but have encountered some issues Even after trying to send the user token to pages using "req", it consistently returns null The middleware file in question is: pages/api/u ...
Is there a way to maintain the values passed from another route on my dashboard? Here is how the dashboard URL appears after receiving a GET request from another route: http://localhost:8000/?lat=45.328686399999995&lng=14.446922599999999 Whe ...
I am attempting to retrieve the Content-Disposition header from a response received via axios from an external API. Even though I can see the header in Chrome DevTools Network Response, I am unable to access it from the server. I came across this article ...
I have encountered a Null pointer exception while making a get request from my back-end spring project. Despite the path being correct and returning the expected value during unit testing, an error occurs when calling via axios get. ERROR: trace: "ja ...
Is there a way to automatically set the content-type header as application/json in the HttpServletRequest when it is not provided by the user? I have been trying to validate this, but so far I haven't found any suitable methods for achieving this. ...