Questions tagged [http]

The exchange of information over the internet is facilitated by a widely employed application layer network protocol known as Hypertext Transfer Protocol (HTTP). Its primary function is to ensure the seamless transfer of content on the expansive platform we know as the World Wide Web.

Node.js and the Eternal Duo: Forever and Forever-Montior

Currently, I am utilizing forever-monitor to launch a basic HTTP Node Server. However, upon executing the JavaScript code that triggers the forever-monitor scripts, they do not run in the background. As a result, when I end the TTY session, the HTTP server ...

Investigating the variety of HTTP 206 responses pertaining to video content

Currently, I am utilizing Amazon CloudFront to serve HTML5 videos. These videos are being requested through HTTP range requests and the expected responses are often in the form of HTTP 206 Partial Content. I have a requirement where I want to log the requ ...

Obtaining Data from a Database Using Angular

I have developed a front-end website using Angular as my framework, integrated with node.js. To interact with the database, I created a "server.ts" file and connected it successfully to my DB. Now, my goal is to fetch data from the database and display i ...

Combining JSON Files within an AngularJS Service

I utilize a Service in my angular application to retrieve JSON data pertaining to a football team. angular.module('UsersApp').factory('SquadService', ['$http', function($http) { return $http.get('squad/squad-bourne ...

Issue encountered in performing a post request using AngularJS

One of the functions in my code is a post call: save2 : function ( lotto ) { var configDistintaIngrediente = { params: { distintaBaseGelato_id: 1, ingrediente_id: 2, quantit ...

Solving CORS issues on an emulator with Ionic3 and Angular4

I'm currently testing my Ionic 3 app on a Genymotion emulator and running into an issue with HTTP requests due to CORS. Initially, I believed it was a server problem but after checking the same server with an Ionic 2 app, everything seemed fine. Surprising ...

Encountering a 401 error when trying to access OneNote resource in Angular 5 with Microsoft Graph

I have encountered an issue while trying to request resources from Microsoft graph (for OneNote API). My concern revolves around the correct method of obtaining an access token. I am utilizing the implicit flow for my Angular 5 frontend application. The p ...

A guide to examining the HTTP response body, including HTML content, using Wireshark

After entering the URL in the address bar of the virtual machine's browser, a request for an HTML document from my host computer was made. The HTML document, which I had personally written, successfully appeared in the virtual machine's browser. This indic ...

The challenge of obtaining a URL as a query string parameter in Node.js Express

What is the proper way to include a URL as a query string parameter in node.js? For example, if I were to access the browser with the following URL: http://localhost:3000/key1/https://www.google.com/key2/c, I am encountering difficulties retrieving value ...

The issue with the Angular 5 HttpClient GET-Request not closing persists

Currently, I am utilizing an Http-GET request to fetch JSON data from my backend service. Service: public storedCategories: BehaviorSubject<Category[]> = new BehaviorSubject(null); constructor() { const subscription = this.http.get&l ...

Having issues with my npm, it's acting up

I'm encountering issues with my npm that seem to persist regardless of whether I try to install using a package.json file or simply installing a node module. Here is the error message that appears in the terminal: npm http GET https://registry.npmjs.org/e ...

Query parameter is not defined

Can anyone assist me with extracting the ean from the following URL: This NodeJS server processes the request in the following manner: const http = require('http') const port = 3000 const requestHandler = async (request, response) => { ...

Prevent unauthorized entry to nodejs express endpoints

I am facing a challenge with the "internal" routes within my application: app.get('/myroute', function(req, res) { res.status(200).send('Hello!'); }); The issue is that this route can also be accessed from external sources: curl http ...

Tips on managing a GET request sent using axios with special characters and accents

When constructing a web page using VUE.JS, a GET request is made with Axios. In the form fields, special characters and accents may be present depending on the user's input. For instance, if the surname entered in the form field is 'Ruíz' ...

Mastering error handling in Angular's Http requests

In my frontend application using Angular, I need to communicate with a RESTful webservice for the login process. The webservice returns different response codes in JSON format depending on the success or failure of the login attempt: If the login is corre ...

Hybrid application: Manipulate HTTP user agent header using AngularJS

I am currently developing a hybrid app using Cordova and Ionic. My current challenge involves making an HTTP request to access a server where I need to modify the user agent of the device in order to pass a secret key. $http({ method: 'GET', ...

Issues with the 'GET' request functionality on the deployed Angular project

I am attempting to run an Angular project that I have built. After copying the folder generated from 'ng build' and placing it in the directory where my back end code (using express) is located, I am trying to run it on my laptop at port 3000. While all of ...

retrieve the source code from all .js links found within the document

There is a file labeled urls.txt. https://website.tld/static/main_01.js https://website.tld/static/main_02.js https://website.tld/static/main_03.js .... All the source code from every .js file in allsource.txt needs to be extracted. Instructions: To ge ...

Determine the HTTP status code for a request using Vue.js and Ajax

I need to retrieve the HTTP status code after submitting a form (using the form submission function): return fetch(serviceUrl + 'Collect', { method: "POST", headers: new Headers({ "Content-Type": "application/json", Authorization: "Bea ...

Retrieve information from Java HTTP event stream

Currently I am engaged in test automation utilizing a Selenium-based Automation framework. My current task involves sending HTTP requests to establish an API suite. The next challenge lies in posting a URL that is embedded within a text/event-stream forma ...

My issue with express routing not functioning properly across various discord servers

While working on a Discord bot that accesses routes from Express, I encountered an issue. It seems to function properly when kept on a specific server, but if I try accessing Express on a different server while it's running, I encounter the error "assignme ...

Exploring the Power of Observables in Angular 2: Chaining and

Hi there! I'm relatively new to Angular and still getting the hang of observables. While I'm pretty comfortable with promises, I'd like to dive deeper into using observables. Let me give you a quick rundown of what I've been working on ...

Making an HTTP request using Kotlin in an Android application

I attempted to retrieve JSON data or something similar by using URL.readText() from java.net.url in Android Studio, but my application crashes. fun ButtonClick(view:View) { textView.text = URL("https://www.google.com/robots.txt").readText() } ...

Executing a series of HTTP requests sequentially using Angular 5

I need some guidance on sending an array of HTTP requests in sequential order within my application. Here are the details: Application Entities : Location - an entity with attributes: FanZone fanZone, and List<LocationAdministrator> locationAdmins ...

Prevent the unwanted 100 Continue behavior in Ajax requests

My Javascript application sends out large POST requests to a backend server. Due to the fact that we need all requests directed to our non-public endpoint and the load balancer/proxies struggle with the Expect: 100-Continue header, I am seeking a way to pr ...

Performing a series of get requests in Angular 2

There is a configuration service that retrieves specific information from a JSON file. getConfiguration(key) { return this.http.get('./app/config/development.json').map(res => { this.result = res.json(); return this.result[key]; }) ...

Angular Testing: Discovering the best practices for asserting expectations post function execution

I'm currently facing a challenge while unit testing my Angular application. I need to make an HTTP call on a local file, but the expects of the test are getting called before and after the HTTP call, causing it to crash. How can I resolve this issue? ...

Encountered a type mismatch in Flutter where an 'int' was expected but a 'String' was provided instead

Recently, I've been diving into creating a quotes app that utilizes a rest API to fetch data and display random quotes at the center of the screen with just a tap. However, I seem to be encountering some hurdles in getting everything to function as in ...

The Content property of the HttpRequestMessage is populated with characters that are invalid and cannot be

After receiving the return from HttpRequestMessage.Contenc, it appears to be encrypted. Has anyone else experienced something similar? var client2 = new HttpClient(); client2.DefaultRequestHeaders.Accept.Clear(); client2.DefaultReq ...

Sending headers after they've already been sent can lead to issues in the handling of HTTP requests in Express or Node.js

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 ...

Issue with Axios in Vue app: Only receiving network errors for Post requests

Using the Following Stack Express,Vue,SQL,Axios Successful GET request in postman and Axios Error encountered with POST request, see attached screenshots To test backend functionality, data was sent directly from a form <form action="url" me ...

What is the reason for storing a base64 string as an Object in a MongoDB database?

I am facing an issue with storing a product detail on the mongoDB database. When I try to save it, mongoDB stores a property imageSrc as an object instead of a string. Here is my database This is my angular service And this is my express server request ...

How can I effectively run and execute JavaScript received from a Node server using Node.js?

Hey everyone, I'm just starting out with Node and I've run into a little issue that I could use some help with. Basically, I have a page at that does some stuff, and I want to connect to the node server which is located at . var server = requir ...

Oops! An error occurred in AngularJs: "TypeError: $scope.todos.push is not a

I am currently facing an issue while using the $http.get method to add a todo from my controller to my database. The error message "TypeError: $scope.todos.push is not a function" keeps appearing, despite trying various solutions suggested by similar quest ...

I am experiencing an issue with my post method where I am not receiving any data back from the

I am using a POST method to send data to the server and I want to receive data back after that. When I subscribe to the post method: this.categoryService.storeCategory(this.currentFileUpload, this.category).subscribe(category => { console.log(" ...

What methods do certain API services use to accept Authorization headers from any source?

Payment processing platforms like Stripe and Square provide the capability to include your API key in an Authorization header as a Bearer token. However, my understanding is that allowing credentials, such as the Authorization header, from all origins is ...

Tips to successfully upload a large CSV file using an HTTP POST request

I am encountering an issue while attempting to transfer a significantly large CSV file from the client to the server within my MEAN stack application. The error message I keep receiving indicates that I am sending an excessive amount of data at once. Erro ...

Error: The index "id" is not defined

Hey there, I have been working on fetching data from a JSON URL located at this link. However, I seem to be encountering an error that I can't quite comprehend. If anyone has any insights or solutions, I would greatly appreciate the help. Thank you in ad ...

Time when the client request was initiated

When an event occurs in the client browser, it triggers a log request to the server. My goal is to obtain the most accurate timestamp for the event. However, we've encountered issues with relying on Javascript as some browsers provide inaccurate times ...

Executing an http.get request in Angular2 without using RxJS

Is there a method to retrieve data in Angular 2 without using Observable and Response dependencies within the service? I believe it's unnecessary for just one straightforward request. ...

Switching from the HTTPS to HTTP scheme in Angular 2 HTTP Service

I encountered the following issue: While using my Angular service to retrieve data from a PHP script, the browser or Angular itself switches from HTTPS to HTTP. Since my site is loaded over HTTPS with HSTS, the AJAX request gets blocked as mixed content. ...

How to stop the HTTP Basic Auth popup with AngularJS Interceptors

In the process of developing a web app using AngularJS (1.2.16) with a RESTful API, I encountered an issue where I wanted to send 401 Unauthorized responses for requests with invalid or missing authentication information. Despite having an HTTP interceptor ...

Implementing TCP delayed acknowledgment in Node.js using the Express framework

During my stress test on nginx with nodejs backends, I encountered a delay related to keepalive. Surprisingly, even after removing nginx from the equation, the problem persisted. My setup includes: ApacheBench, Version 2.3 Node v0.8.14. Ubuntu 12.04.1 ...

Ways to incorporate a custom JavaScript function that is activated by an external server system?

I'm currently exploring a JavaScript widget that needs to operate within specific constraints: The widget initiates a request to a third-party server using a callback URL The third-party server pings the callback URL after a set period, triggering a meth ...

Tips for resolving the error message "The getter 'length' was called on null"

I uploaded a PHP file on my college server, and it works fine when accessed directly from the server. The JSON data can be retrieved by running the PHP file at this link . However, when trying to access the same data in a Flutter app, I encountered an erro ...

Error with Angular 2 observables in TypeScript

When a user types a search string into an input field, I want to implement a debounce feature that waits for at least 300 milliseconds before making a request to the _heroService using HTTP. Only modified search values should be sent to the service (distin ...

Is there a way to modify the maximum size limit for a POST request package?

I am encountering an issue while attempting to send an array of bytes using a POST request. In my server-side implementation, I am utilizing Node.js and Express.js. Unfortunately, I am receiving error code 413 or the page becomes unresponsive ('PayloadTooL ...

Utilizing Angular: Integrating the Http response output into a map

I have a situation where I am making multiple HTTP calls simultaneously from my Angular application. The goal is to store the responses of these calls in a Map. data: Map<number, any> = new map<number,any>(); --------------------------------- ...

Angular HTTP post is failing on the first attempt but succeeds on the second try

Just started working on my first Angular exercise and encountered an issue where I am receiving an undefined value on the first attempt from an HTTP post request. However, on the second try, I am getting the proper response in Edge and Firefox. Thank you f ...

How can one effectively monitor the advancement of a file transfer operation?

Looking at integrating a Spring Boot REST API with an Angular Frontend, I am interested in monitoring file upload/download progress. I recently came across an informative article that dives into the implementation details of this feature. The approach see ...

Retrieve the post content without using bodyparser

I have been attempting to send a base64 encoded image to my express server and process it there to save it to disk. I want to achieve this using a simple HTTP POST request, but so far I have not been successful. Previously, I had a solution that involved a ...

Using jQuery AJAX enforces the use of HTTPS

Here is the current setup: Using jquery version 2.1.1 Employing nodejs (not a crucial factor) Making requests over https The issue at hand: When using $.getJSON() and $.get(), the URL requested appears as "". Despite confirming the correctness of the UR ...

Mapping Functions to HTTP Status Codes

I'm just getting started with my ajax-jquery learning journey. How does jquery determine the success or failure of a request? (When is success called versus when is error called?) I have a hunch that it has something to do with the HTTP status code ...

What is the best way to send an action based on the HTTP method being used?

I've been utilizing NGXS for handling state in my angular project. What would be considered a best practice? Should I make the HTTP call first and then dispatch an action within its subscription? Or should I dispatch the action first and then make t ...

What is the best way to create user profiles using the URL domain.com/username rather than domain.com/profile.php?user=username?

Recently, I developed a website that features profiles for each member. The user data is stored in a MySQL database while their profile pictures are saved in a folder named "pictures" with the username as the filename. Each member's username is unique. O ...

What is the process of sending a file from a remote URL as a GET response in a Node.js Express application?

Situation: I am working on a Multi-tier Node.js application with Express. The front end is hosted on an Azure website, and the back end data is retrieved from Parse. I have created a GET endpoint and I want the user to be able to download a file. If the f ...

How to Calculate the Time Interval Between Two CORS Requests Using jQuery AJAX

When using jQuery's $.ajax to make a CORS request to a web service, there is typically a pre-flight request followed by the actual POST request. I have observed that when there is a time gap between making two web service calls, both a pre-flight and POST ...

Have you considered utilizing encodeURIComponent to encode both the key and parameter values?

When I use encodeURIComponent in this code snippet: export function getDownloadFileUrl(fid: string,bgColor: string) { const params = encodeURIComponent("id=" + Number(fid) + "&bgColor=" + bgColor); const config = { m ...

Encountering an Express.js HTTP 500 ERROR when using res.send("Some text"); is working on the page, however, the error occurs when trying to use res.render('file');

My website has a page located at /request that features a form. The form's method is POST and the action leads to /request. In the POST handler in request.js, the intention is to take action with the form data, like storing it in a database, and then ...

Function for checking API status

I'm currently working on an IF statement that will check for results from two API call functions and terminate when it receives results. function fetchYelp() { let token = '<token>'; axios.get('https://api.yelp.com/v3/businesses ...

The Express server effortlessly included a vulnerable ETAG

Exploring HTTP caching, I developed a basic Express node.js server to experiment with different caching mechanisms. const express = require('express') const serveStatic = require('serve-static') const path = require('path') const app = exp ...

Leverage the output from one $http request in AngularJS to make another $http request

My goal is to use $http to fetch data (such as students), then make another $http call to retrieve studentDetails. Next, I want to add a portion of studentDetails to the students JSON. The tricky part is that I need the response from the first call to cre ...

Guide to Setting up the TRACE Request Response in express.js

The HTTP TRACE method is a valuable tool for conducting a message loop-back test along the path to the target resource, making it an essential debugging mechanism. The final recipient of the request must echo back the received message as the body of a 200 ...

Guide to changing the status code to 404 for a 404-page in Next.js

I have been trying to figure out how to set a 404 status code for the 404-page in Next.js. The response I received stated that the status code is already 404 by default, but upon closer inspection, it seems that all bad requests are returning a 404 status ...

Combining multiple API requests into a single call in a REST API

Consider this scenario: I have an API call http://localhost:3006/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="fb889e959fd6969e88889a9c9ec49e969a9297c69a9998bb968288928f9ed59894">[email protected]</a>&passw ...

AngularJS $scope variable can be initialized only once using an HTTP GET request

I'm facing an issue with fetching data from an API in a separate AngularJS application. There's a button that triggers the retrieval of data from the API. Upon clicking, it executes the $scope.getApiData function, which is connected to $scope.productlist. ...

"Submitting an HTML form and displaying the response without redirecting to a

I created a basic portlet for Liferay that includes a form for inputting parameters to send to an external webservice. However, when I submit the form, I am redirected to the URL of the webservice. Is there a method to prevent this redirection and instead ...

The functionality of Access-Control-Allow-Origin is not effective in Chrome, yet it operates successfully in Firefox

I'm facing an issue with my code in the HTML file. I have a second file that I want to load content from, and both files are located in the same directory <div id="mainMenu"></div> <script> $(function() { $('#mainMenu').load( ...

Methods for eliminating curly braces from HTTP response in JavaScript before displaying them on a webpage

When utilizing JavaScript to display an HTTP response on the page, it currently shows the message with curly braces like this: {"Result":"SUCCESS"} Is there a way to render the response message on the page without including the curly braces? This is the ...

Stop /Terminate the Angular 2 HTTP API request

Occasionally, the loading time for an http API call can be quite lengthy. However, even if we navigate to another component, the call still continues execution (which is visible in the browser console). Is there a method or approach that allows us to can ...

What is the best method for circumventing an express middleware?

I am currently working on an express application that utilizes several express routes, such as server.get('*' , ... ) to handle common operations like authentication, validation, and more. These routes also add extra information to the respon ...

Angular HTTP client failing to convert response data to specified type

Recently, I started using the new HttpClient and encountered an issue where the response is not cast with the provided type when making a call. I attempted to use both an interface and a class for casting, but it seems that only interfaces work as shown in ...

Bing Translator and XMLHttpRequest are two powerful tools for translating and

When running the code snippet below, I encounter an issue where I am not receiving status 200 and responseText. However, when using the following URL: http://api.microsofttranslator.com/V2/Http.svc/GetLanguagesForTranslate?appId=F1B50AB0743B541AA8C070890 ...

HTTP request in Angular with specific body content and custom headers

My goal is to access the sample API request from , as demonstrated in the documentation: curl -H "api-key: 123ABC" -H "Content-Type: application/json" -X POST -d ' ...

Getting the value returned by http.request in an app.get method using express.js

When attempting to deliver data from an API on another domain using app.get, I am able to write the data to the console successfully. However, the data is not showing up on the page ('~/restresults'). This is the current code I have: app.get('/restresult ...