Questions tagged [get]

The HTTP protocol supports numerous request methods, and among them is the GET method. GET is employed by the client when it intends to obtain data from the server as an element of the request-URI.

When making a GET request, `req.body` will consistently be found void of any

Why is my req.body always empty on a GET request in Express 4.13.3, but filled with correct data on POST requests? I couldn't find any explanation for this difference in the Express documentation. This is my current Express configuration: function o ...

Sending data through $_GET with a dropdown menu option

I'm facing an issue with my PHP page where I am displaying multiple images on HTML from a database. The page includes 3 drop-down menus for sorting: Sort (oldest / newest) Type (Jpeg or GIF) Number of Images per Page (Using Pagination) For example, ...

Ways to extract link value in Angular

Is there a way to extract a value from a link using Angular 4? I have used *ngIf and would like to display a div based on the value within the link. <div *ngIf="obtain the value from the current href"> ...

Perform a jQuery AJAX GET request while passing the current session information

Is it possible to retrieve the HTML content of another webpage using jQuery, particularly when that page is already signed in? In simpler terms, can we use $.get() to fetch a different page on the same website and transfer the PHP/Javascript cookies with ...

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

Encode JavaScript field without affecting the appearance

I need to encode a specific search field before submitting it as a $_GET request. To do this, I am using the encodeURIComponent() function on that field before the form is submitted. $('#frmMainSearch').submit(function() { var field = $(this).find('#s ...

Guide on utilizing a dual-parameter route in Node.js with the GET method

Need help with using 2 parameters in 1 route (get)? Check out my code below: router.get('/', function (request, response) { Result.find(function(error, results){ if (error) console.log(error) response.render('index', {results:resul ...

How can React Native efficiently retrieve data from multiple APIs simultaneously?

In my current project, I am incorporating multiple APIs that are interlinked with each other by sharing the same data structure... Below is the code snippet: export default class App extends React.Component { constructor(props) { super(props); } ...

How can you retrieve data in Angular through an API call using the get method?

How can I make an API call to retrieve data from this URL, , using a GET method without passing any parameters in my Angular application? What is the code snippet required for this, and do I need to import any specific libraries or declare specific variabl ...

jQuery mistakenly sends a GET request instead of a POST request

Has anyone encountered an issue where attempting to send a POST request to Flask using jQuery results in a GET request instead? This is a new problem for me, and I'm unsure why it's happening. jQuery system_data = { "system_name":"system_name ...

Issue with AngularJS form not binding to $http request

<form novalidate class="form-horizontal"> <div class="form-group"> <div class="col-sm-offset-2 col-sm-10"> <div class="text-capitalize"> </ ...

Storing JSON data for retrieval using Ajax request

Apologies if this is a silly question. I am working with a JSON data file and I want to retrieve it using AJAX. Since the data is already serialized, do I still need an action result to return JSON? Or not? Is it okay to store the JSON file within my pro ...

Troubleshooting problems with Jquery qtip ajax

I am currently attempting to send the value of an input box (specifically an IMDb link) to my imdbgrabber.php page in order to retrieve information about that movie and display it in a qtip box. EDIT: You can view the issue here. Hover over the images to ...

Using ExpressJS with the GET method to retrieve JSON data in conjunction with Angular version 4 and above

This inquiry may be a duplicate, I apologize for any repetition. My objective is to console.log JSON data from the "Server" folder. Please find the attached folder structure below. https://i.stack.imgur.com/uec4O.png server.js const express = require('e ...

Django and Ajax: efficiently passing URL parameters within data payload

Seeking to establish "GET" and "POST" requests to Django server through Ajax. Initially, setting up the URLConf: url(r'^write_to_file/(?P<file_name>.*)/(?P<content>.*)/$',generalFunctions.write_to_file, name ='write_to_file&apo ...

An issue occurred while attempting to retrieve Firebase data using an HTTP GET request

When trying to retrieve my data from firestore using an HTTP get request, I encountered an error. It might be helpful if my data in firestore was stored in JSON format. I'm not sure if this is feasible. <!DOCTYPE html> <html lang="en"> < ...

Implementing Node.js with Express to handle app.get requests that include multiple query parameters

I am trying to utilize the Yelp API with the following route: app.get("/yelp/term/:term/location/:location", yelp.listPlaces) However, when I send a GET request to http://localhost:3000/yelp?term=food&location=austin, An error occurs stating Canno ...

The ajax request using type:"GET" is successful in firefox and chrome, but encounters issues in Internet Explorer

Hey everyone! This code snippet works smoothly on Firefox and Chrome, where it successfully passes the data and displays the confirmation page. However, when I try to run it on Internet Explorer, the page simply refreshes and all the data passed becomes N ...

Sending an HTTP GET request to an API can result in different outcomes depending on whether it is sent to localhost or to a remote server. In some cases, the

My setup involves Angular for the front end and Slim for the back end. Interestingly, when I send a request locally, everything functions smoothly, and I receive the JSON response as expected. http://localhost/domain/api/jobs However, the situation chan ...

Tips for starting the debugging process with POST and GET requests in Django and the Python Shell

I've encountered an issue with my code where the database is not updating and a new record is not being created. I suspect that there may be a problem with how I am handling the POST data retrieval in my script. Can anyone provide guidance on where to ...

Is there a way to transfer data from the controller (in JSON format) and display it in a ListBox within the

As a newcomer to ASP.NET Core, my main goal is to easily populate a listbox with data from a JSON file. Take a look at the controller class below: public class EmployeeController : Controller { public IActionResult Index() { return View() ...

AngularJS $http get isn't functioning properly, but surprisingly $.ajax works perfectly

Recently delving into the world of AngularJS, I am facing a hurdle with $http functionality. In my factory setup below: app.factory('employeeFactory', function ($http) { var factory = {}; // Retrieving data from controller var employees = []; ...

Incorporating data from a MySQL database into a PHP page using a variable included in the URL

I am currently working on designing a website and one of the features I would like to implement is the ability to create unique URLs for users. My goal is to have the URL structured as follows: http://www.example.com/page.php?user_id=3 Each user would ha ...

Unable to retrieve object using ajax GET from the controller

I'm facing an issue where I am trying to send back an object in JSON format to my JavaScript code. However, when attempting to do so, the error event is being triggered with a parseerror message. What could be causing this problem? $.ajax({ url: ...

The utilization of the $.ajax() function to retrieve data from a remote URL

My task involves reading this remote XML file: , in an HTML file using Ajax! This is the code I have written: <script type="text/javascript"> getReadXmlFile(); function getReadXmlFile(){ alert("Searching for file"); $.ajax({ typ ...

Accessing a file's source using the Box.net API and downloading the file contents

Recently, I've been busy working on a Web Application project (for fun) that focuses on editing files stored in the cloud. I'm utilizing the box.net API for this task, but I've come across a challenge - obtaining the source code of files. Unfortunately, ...

Analyzing query arrays using requests and handling responses with express

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

Is it feasible to send a GET form to two separate views using two buttons?

On one view, I have a form that functions perfectly. http://myurl.com/myapp/filter_objects/?risk__worktask=1&craft=3 In another view, I need to export the filtered list to a PDF. Currently, I store the results in session and access the list from ther ...

How do you display a GET request response onto a Jade page?

After successfully making a GET request to an API, I am now looking for a way to display the response on a Jade page. Below is the code snippet from 'index.js' located in the routes folder where the GET request is implemented. Any suggestions on ...

Transferring Cookies through FETCH API using a GET method from the client-side to the server-side

Struggling with a challenge here: Attempting to send a cookie via a GET request to determine if the user is logged in. The cookie is successfully transmitted to my browser and is visible in the developer tools. When I manually make a request through the UR ...

From a Single Link: A Duo of Distinct Redirects

I used to have a URL that accepted both GET and POST requests. Now, I want it to handle only POST requests and redirect any other type of request. After researching on this topic, it seems that using a 303 status code for a successful POST request and a 30 ...

Error: Angular encountered an issue while loading the resource. Preflight response was not successful

I am attempting to send a request to an API endpoint using Angular in order to retrieve JSON data. Check out my code snippet below: import { Component, OnInit } from '@angular/core'; import {HttpClient} from '@angular/common/http'; imp ...

The res.json method does not include headers for the HTTP status code

I need help adding headers to the json object I am sending. Despite my attempts to use the setHeaders method, I keep encountering a Can't set headers after they are sent. error. In a helpful response on Stack Overflow, it is mentioned that Since vers ...

Having trouble with PHP's $_GET not reading my AJAX URL accurately

It seems like there might be an issue with how the $_GET variable is interpreting my ajax URL, possibly due to a deep linking plugin I have installed. The final URL that is causing trouble looks like this: /dashboard.php#/projectSetup.php?mode=edit&ge ...

When attempting to send a GET request to the server, there is no response received, although the

I am having an issue with an ajax request I am sending to my server using jQuery's get function. The request is being sent successfully, as Firebug shows a 200 status code, but the server does not provide any response. Even when I enter the address di ...

Encountering the error message "Unable to retrieve /todos."

I recently built a basic Express application and am currently testing the POST route using Postman. However, I keep encountering an error message saying Cannot GET /todos. Any thoughts on what might be causing this issue with the following code? const ex ...

PHP Question: Why are variables within <?php ?> not accessible within if/else statements?

I'm currently working on a basic program that involves the user inputting a number, which is then processed to generate a series of random similar numbers. After this step, the program prompts the user to select the correct variable, which will be va ...

Is there a way to trigger an Axios response without repeated calls or the use of a button?

As I navigate my way through using react and Axios, I encountered an issue with a get request in my code. Currently, I have a button that triggers the request when clicked, but I want to eliminate the need for this button and instead have the information d ...

Doing server side function calls from the client in NodeJs

I recently embarked on a journey to learn web development and am eager to make server-side data changes when invoking client functions. Take a look at my sample server setup: const fs = require('fs'); const path = require('path'); con ...

When using LWP::Simple::get, the URL that typically functions in a browser may not yield the desired

#!/usr/bin/perl use strict; use warnings; use JSON qw( decode_json ); use LWP::Simple; my $cavirtex = get('https://www.cavirtex.com/api2/orderbook.json?currencypair=BTCCAD'); print $cavirtex; After running the code, I encountered the following ...

Why doesn't Vue's computed method call the 'get' function after setting a dependent value in the 'set' function

Allow me to explain how I define a computed value: Template : <date-picker v-model="rangeDate" type="date" format="jYYYY/jMM/jDD" display-format="jYYYY/jMM/jDD" input-c ...

Totally clueless when it comes to JSON

After diving into tutorials on JSON, the structure and syntax are finally clicking for me. However, I'm currently working on a project that requires a GET, and it seems like JSON could help with this. I've come across comparisons of JSON and AJAX, which r ...

Using the jQuery AJAX function to modify the URL query string

I currently find myself on a webpage Is there a way to add a URL query string without reloading the page? For example, when I click a button, can the URL change to using jQuery ajax functions? ...

Why do my paths encounter issues when I alter the manner in which I deliver my index.html file?

I recently made a decision to change the method of serving my index.html file from app.use('/', express.static(__dirname + '/..')); to app.get('/', function(req, res) { res.sendFile(path.join(__dirname + '/../index.htm ...

What is the best way to retrieve promiseValue from the response array?

I've run into some challenges while using Promise.all() for the first time with two get-methods. When I check the response in my console log, I can see the data I'm trying to fetch under promiseValue. However, I'm unsure of how to access it. Here's the sn ...

Basic jQuery fetch request

Having some trouble implementing an onclick button to send a get request to a php file. The jQuery is loading correctly, so that's not the issue. Check out the code below: The function that needs to be called <script type='text/javascript'> f ...

ReactJS universal-cookie package experiencing issue with get() method

I am facing an issue with the interaction between two components stored in separate .js files. import Cookie from 'universal-cookie' class Comp1{ someFunction(){ // Call google Oauth // get userinfo from Oauth response and set the token bel ...

Extract the last word from the URL and remove any unnecessary components

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

What is the best way to implement an object literal method for making an HTTP GET request to retrieve JSON data?

I'm facing an issue with the HTTP GET method when trying to retrieve JSON data. Although the HTTP GET method is successfully fetching the JSON data, I'm struggling to connect it with the object literal. For better clarity, here's the specif ...

No display of Vimeo channel and videos

Currently, I am utilizing the Vimeo API in conjunction with axios and react to access a specific channel. Although my code appears to be properly configured, upon compilation, I encounter the following error: TypeError: Cannot read property 'map' of un ...

Requesting information asynchronously returns a positive response

I wrote the following code: if (venue_exists(instagramUserID)){ alert('A'); }else { alert('C'); } function venue_exists(instagramUserID) { $.get( "/venues/" + instagramUserID, function(json) { if ( ...

Add new data to an existing array in Angular 7 without overwriting it

After clicking a button, I'm retrieving data from the WordPress API: <a (click)="initGetComments()">Get comments</a> This is the code snippet: export class AppComponent { commentsResults: CommentsItem[] = []; ...

Is there a way to display the data from a URL as selectable options in a dropdown menu?

I have a URL containing an arrayList of data. My task is to fetch the data from this URL and display it as options in a dropdown menu, allowing users to select the desired option. I am aware that this can be achieved using the Get method, but I am facing d ...

Nodejs GET method encountering difficulty with Redirect handling

I've implemented a POST method in my NodeJS code to handle login authentication // Login logic app.post("/home", function(req, res){ Item.findOne({EmailID: req.body.emailAddress}, function (err, docs) { if(req.body.emailAddress === docs.E ...

The second click does not trigger the AJAX get method

I am currently utilizing jQuery version 1.7.2. The code snippet below is responsible for creating checkboxes within a bootstrap modal form (version 2.2.1): $sql1="Select $sub_listing_id,$sub_listing_name FROM $sub_listing"; $results=$wpdb->get ...

In AngularJS, the $http get method is displaying the status code of the data object instead of

After pondering over this issue for several days, I am still unable to pinpoint what I am doing wrong. Any suggestions or insights would be greatly appreciated. My challenge lies in trying to showcase the response from a rest service to the user by utilizi ...

Tips for extracting parameters from a URL using Express JS in a custom manner

Recently, I set up a server using the express package and encountered an issue while trying to extract parameters from the URL in a specific format. The URL structure is as follows: (notice there's no '?' indicating parameters). I am looking for a way to ...

Implement the HTML code for utilizing the GET method in an AJAX request

I'm exploring a way to utilize inline HTML directly as the URL for the ajax GET method without fetching data from a separate webpage. Is it feasible? Here is my ajax code: $.ajax({ type: "GET", url: $(elm).attr("href"), ...

Unable to interpret the GET request

I am encountering an issue with reading a GET request on my web server. The request is not being processed as expected and I need the output to be displayed after 10 seconds once the user makes the request. Can anyone provide assistance? The goal of the ...

Using @GET parameters with Android's retrofit

I have created an interface to fetch weather data from the OpenWeather API for the city of RZESZOW in the country POLAND. How can I pass query parameters for the user to input their desired city name and country in order to get the weather data? public in ...

Transmit and receive information between Javascript and Node.js through Express framework

Currently, I am utilizing the Express platform along with the Twilio Node.js SMS API and JavaScript to send text messages to my users. However, I am facing an issue in sending data through GET variables on the front-end and capturing those values with node ...

Interconnected Dropdown Menus

I've implemented the cascading dropdown jQuery plugin available at https://github.com/dnasir/jquery-cascading-dropdown. In my setup, I have two dropdowns named 'Client' and 'Site'. The goal is to dynamically reduce the list of sites based on the client s ...

"Efficiently fetch data with an Express GET request without the

My goal is to send the client the HTML page (create.html) in response to a GET request triggered by a button click using fetch. I am intentionally avoiding the use of a form due to formatting and potential scalability issues. The code acknowledges that the ...

Is there a way to retrieve a specific section of a webpage using an AJAX GET request?

When making a GET request to the server, we can retrieve an entire page. However, what if I only need the content of a specific div on that page? Do I have to fetch the entire page and then use jQuery's find() method to extract the div content? Or is the ...

Utilizing the $_GET method with dynamic URLs

My issue involves working with dynamic URLs, where I have created a structure like this: http://www.example.com/index.php?page=test The problem arises when I try to send values via GET. Due to the URL structure being as follows: http://www.example.com/i ...

Issue encountered: missing photo data during the transfer of an image from ReactJS to MongoDB

When an image is uploaded to my website, it is sent to the backend for storage in MongoDB database. The base64 of the image is uploaded to the database, but occasionally the photo data retrieved can be "false". For example: (3) [{…}, {…}, {…}] 0 : p ...

I am encountering a 404 error when attempting to make a GET request for a file located in the same directory

Here is the Javascript code that utilizes the get method. The directory contains both files - the HTML file where the JS code resides, and the text file. Below is an image of the console displaying errors. ...

Using jQuery to send a GET request to the current page with specified parameters

Within my application, hosted on a PHP page, I am aiming to trigger a GET request upon selecting an option from a dropdown menu. The URL of the page is: www.mydomain.it/admin/gest-prenotazioni-piazzola.php I intend to utilize jQuery to execute this GET r ...

Click event binding with getter/setter in jQuery

Is there a way to replace this timeout with a getter/ setter? I want the images in the filter gallery to be sorted based on the globalVariable value when a user clicks on a section. Currently, I am using a timeout which stops working after one click. I ha ...

I'm having trouble retrieving data from the server using the AngularJS $http.get() function. What am I doing wrong

Ensure that your question is clear and that your code properly showcases the issue at hand. Feel free to leave any questions or comments below for clarification. app.js var express = require('express'); var app = express(); app.use(express.sta ...

Guide to extracting information from a Node.js http get call

I am currently working on a function to handle http get requests, but I keep running into issues where my data seems to disappear. Since I am relatively new to Node.js, I would greatly appreciate any assistance. function fetchData(){ var http = requir ...

What issue is present with this AJAX query?

Can you help me figure out where I went wrong with this AJAX code example that I'm trying to learn from? function loadXMLDoc() { var xmlhttp; if (window.XMLHttpRequest) {// code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp=new XMLH ...

Struggling to access the Angular Route

I am facing an issue where I can't seem to open the route "/d", while "/" is working perfectly fine. I have tried various troubleshooting methods but unfortunately, haven't been able to find a solution yet. var myApp = angular.module('myApp ...

Using the CURL function to extract the encoded URL from the GET request

I am currently facing an issue with passing a URL from GET and using it in a curl request, as the URL needs to be encoded. Even after trying to use the proper function, urlencode, I'm unable to make it work. It's possible that I am not initializ ...

Obtaining JSON data using PHP

Received JSON string from the API response {"accessTokenResponse":{"token":"562371e99fda4296a380547cb5bf9fab","token_type":"Bearer","expires_in_seconds":"77476","client_id":&qu ...