Questions tagged [post]

POST is a fundamental part of the HTTP protocol methods, crucial for sending data from the client to the server. It comes into play when tasks like uploading a file or submitting a form are necessary. While the word "post" can carry various meanings, in this context we specifically refer to HTTP POST requests only.

Getting a return value from a post request in NextJs 9 Serverless: a step-by-step guide

I am currently working on a serverless application using NextJs but I have hit a roadblock when trying to retrieve a user's JWT in the return value after making a post request to my database. While everything else seems to be functioning correctly, th ...

While the MySQL syntax error is causing issues in the PHP application, it runs smoothly in the MySQL

UPDATE: Check out the 'solution' in my comment below I am currently executing an AJAX POST request to my backend PHP, where form data is transmitted to a dedicated CRUD PHP script that is responsible for creating a new record. The SQL syntax I am using r ...

When using $resource.save, it returns a "Resource" instead of just an ID

For some reason, I am struggling with a seemingly simple task and cannot find a solution by going through documentation or other Angular related questions on SO. I may not be the brightest, so I could really use some help here as I am feeling stuck. Take ...

Is there a way to prevent redundant retrieval of model data following a post method in an MVC framework?

In my Asp.net application utilizing the MVC pattern, I am faced with the challenge of handling a massive collection of data represented by logs. Users can request specific logs, and these requests are managed through ElasticSearch. The response from Elasti ...

The POST value has been identified in the raw post data, but it is not present within the php $_

Here is my unprocessed post data: ------WebKitFormBoundaryXQrRmAvDBGudXqzO Content-Disposition: form-data; name="cmd" update_cars_item ------WebKitFormBoundaryXQrRmAvDBGudXqzO Content-Disposition: form-data; name="john_id" 30 ------WebKitFormBoundaryXQr ...

What is the best approach to invoke a different REST API from an Express route?

I've built an express.js REST API with a bunch of different routes, but I'm looking to add a new one that calls another REST API and returns the result. Here's what I have in mind: router.post('/CreateTicket', cors(corsOptions), function(req, res, next) { ...

Using an Ajax request, form data is captured and then sent via POST to a PHP script in order to be added

I'm feeling a bit out of my depth with this, but here's the situation. I inherited a form that has one input field for email and a submit button. The code was not written by me, so I'm struggling to understand it. I've tried researching the .ajax jQuery co ...

The preflight request in Angular2 is being rejected due to failing the access control check: The requested resource does not have the 'Access-Control-Allow-Origin' header

I encountered an issue while attempting to execute a basic POST request to establish an account using an API in .NET. The process fails with the mentioned warning title. Interestingly, performing the same request in Postman (an API testing tool) yields a s ...

Sending extensive information using PHP

Utilizing both stream_context_create and fopen, I am able to securely send data using the POST method in PHP. While $opts['http']['content'] functions beautifully, I now face the challenge of sending an exceptionally large file that cannot be stored in me ...

Creating a Basic jQuery AJAX call

I've been struggling to make a simple jQuery AJAX script work, but unfortunately, I haven't had any success so far. Below is the code I've written in jQuery: $(document).ready(function(){ $('#doAjax').click(function(){ alert('The button has been cli ...

Codeigniter displays a view with an empty variable

After submitting data from another form, I am able to successfully retrieve and print the ID with `print($id)`. However, when I try to pass it to the view, the value returned is null. Below is the code snippet: Jquery post function viewAccount(orId) { ...

The AJAX request to send data to PHP is not functioning correctly

I have an issue where I am trying to send data to my server using AJAX in PHP. Even though I have set the method as POST, it seems to be executing as a GET request instead. Here is the code snippet: $.ajax({ type: 'POST', data: { user: user }, ur ...

Retrieving input data from FormSubmit command

I have implemented Formsubmit to manage forms on my websites, but I do not want users to be redirected to another page when submitting the form. My website is hosted on Netlify and when I tested the forms, I did not receive the information in my email. I a ...

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

Incorporating JSON Data into a Collection within my Controller

I have read numerous posts that somewhat touch on my situation, but they all leave me feeling perplexed. Currently, I am sending an object via a POST request to my Controller. I have managed to get the post to reach my controller using the following code: ...

The Swift HTTP request is missing any post data

When attempting to send post data via http to the server, it seems that no post data is being returned. Below is a snippet of the code I used: var request = URLRequest(url: URL(string: "http://posttestserver.com/post.php")!) request.httpMethod = "POST" re ...

What could be preventing this AJAX call from running correctly?

I am in the process of developing a website that provides users with a discount based on a promotional code they can input. It is important for me to verify the validity of the code in our database before allowing a new sign-up to proceed. Below is the AJA ...

Performing a jQuery post request using AJAX and setting the content type

Greetings, here is the code snippet: <script type="text/javascript"> 14 $(document).ready(function() { 15 $('#find').click(function(){ 16 17 var amount = $('#amount').val() ...

AJAX - transmitting JSON data unencoded over the network

PURPOSE & CONTEXT Analyze two text samples that describe different products. Sample 1 is extracted from a form textarea and sent via AJAX to compare it with Sample 2, retrieved from a database. I am experimenting with sending it as a JSON object beca ...

Unusual issue with jQuery's AJAX functionality

Utilizing jQuery AJAX, I am fetching data from a PHP page and displaying a loading GIF image in the placeholder to indicate that results are being processed. $(".project").change(function(){ $(".custName").html("<img src='/admin/images/ajax ...

When testing my POST request online, it functions properly. However, I am facing difficulties in getting it to work in next.js as I keep receiving a 405

I am currently working on establishing a connection to Zoho Creator in order to retrieve some data. After successfully testing the request on and receiving the correct response, I encountered an issue while trying to implement it within a next.js applicat ...

Having trouble sending a x-www-form-urlencoded POST request in Angular?

Despite having a functional POST and GET service with no CORS issues, I am struggling to replicate the call made in Postman (where it works). The only thing I can think of is that I may have incorrectly set the format as x-www-form-urlencoded. When searchi ...

problem encountered while attempting to transmit data to multer in React

I was attempting to upload an image to the backend using Multer. I have reviewed the backend code multiple times and it appears to be correct. Could there be an issue with my front-end code? Here is a POST code snippet: const response = await fetch('http: ...

How to extract data from a JSON file in Java without relying on org.json library

I need help extracting the first element in the "key" array and its corresponding value from the given JSON data. I have come across examples using org.json, but it seems outdated. Can anyone suggest the best way to achieve this with the provided JSON file ...

Tips on sending arrays to PHP via HTML forms

Issue resolved, refer to my FINAL ANSWER post for a detailed explanation of the successful solution *original question and edits below: In search of a method to update multiple SQL entries using a posted array. I believe I am using PHP5. This is how I ...

"Error: Trying to access form data in Node Express 3.4.4 with Jade returns

The code below is part of the app.use section // Setting up redis session store app.use(express.cookieParser()); app.use(express.session({ store: new redisStore({ host: 'localhost', port: 6379, ...

The post() method in Express JS is functioning flawlessly in Firebase cloud function after deployment, however, it seems to encounter issues when running on a

https://i.stack.imgur.com/bIbOD.pngI am facing an issue with my Express JS application. Despite having both post() and get() requests, the post() request is not working on my local machine. It keeps throwing a 404 error with the message "Cannot POST / ...

Performing an Ajax POST request using jQuery

I am currently working on modifying my code to use POST instead of GET to send variables to a PHP page. The current code sends data via GET and receives it in JSON format. What changes should I make in order to pass the variables to process_parts.php usi ...

Checkbox values are not being properly returned in the AJAX post request

var selectedValues = $('input:checkbox:checked').map(function() { return this.value; }).get(); $.ajax({ type: 'POST', url: 'showdata.php', data: {values : selectedValues}, success: function(response) { // Only the value of the last selected ...

The Angular HttpClient is unable to retrieve the message from the response body

I am in the process of implementing a post request using HttpClient to send data to my getFeedback endpoint and display the response in my application. I have a codeService and a dashboard component. Here is the code snippet for the post method in my code ...

Is there a solution to rectify the error related to POST net::ERR_CONNECTION_REFUSED?

Every time I try to post via ajax, an error keeps popping up. Here are the snippets of my code: let xhr = new XMLHttpRequest() let data ={ "name": "test", "phone": "12345678", "email": &qu ...

Dealing with 401 Unauthorized error and CORS issues in Angular POST requests to a .NET Core Web Api

My front-end and back-end projects are separate, using Angular for the front-end and .NET Core WEB Api for the back-end. I have successfully set up CORS and windows AD authentication. While GET calls work fine, I am experiencing issues with POST requests. ...

jQuery AJAX POST Request Fails to SendIt seems that the

The issue I am experiencing seems to be directly related to the jQuery $.ajax({...}); function. In PHP, when I print the array, I receive a Notice: Undefined index. I would greatly appreciate any advice or guidance on this matter. <script> $(docume ...

Employ jQuery to send data to a php script

I am currently developing a search engine and I am trying to send data from jQuery to PHP. Below is the jQuery code I am using: <script> $(document).keypress(function(e) { if(e.which == 13 && $('#textfield').val()) { $ ...

What is the best way to send information to jQuery from an ASP.NET page?

There seems to be an abundance of resources discussing how to post data from jQuery to an ASP.NET page with AJAX, but I have not come across any for the reverse scenario. Can someone enlighten me on how to invoke a jQuery method from an ASP.NET page? ...

What is the best way to send JSON data from NodeJS to Django?

Our app's architecture utilizes a combination of NodeJS and Django. I am looking to send JSON data from NodeJS to Django without waiting for any prior request from Django. Essentially, whenever a function in NodeJS generates JSON data, it should be automa ...

IE10 does not support Ajax functionality

I am facing an issue with a demo that uses jQuery AJAX post. The demo works fine on Chrome and Firefox, but it does not work on IE10. You can view the demo here. I would appreciate any help in resolving this problem. Thank you for your assistance. Here is ...

Sending a post request with a PIL Image in Python

<PIL.WebPImagePlugin.WebPImageFile image mode=RGB size=1600x1600 at 0x1F4E779BA00> is the type of file I'm working with. When I make a post request, I encounter this error: TypeError: a bytes-like object is required, not 'WebPImageFile'. Any sugges ...

Issue with the format of incoming data in Ajax post request when working with Django framework

Hello everyone, I am currently working on a script to send a post request to my Django backend. My goal is to have the data in Json format. <input id ="my" type="submit" onclick="me()"/> <script> function me() { var data2 =JSON.stringif ...

The attempt to fetch the submitted data via the PHP URL was unsuccessful

I have a form and I've created a URL to fetch data. The data is being fetched properly, but when I try to access the URL, it shows {"error":"null"}. How can I retrieve the submitted value? I am having trouble displaying the web services as I attempt to cre ...

Sending requests through RoR and receiving JSON responses - what's next?

Hey there! So I'm diving into the world of Ruby on Rails and I've managed to create a form that sends data to an external widget which then returns JSON. Here's what my form looks like: <%= form_for :email, :url => 'http://XXX.X ...

The PHP code snippet for checking if a post request is set

<?php echo isset($_GET["name"])?$_GET['name']:'ddd'; ?> <?php ... $url = ("http://localhost/web12/directory/list=".$_GET['name'].""); //echo $url; ... ?> <form action="t.php" method="post" target="_self"> <a href="t.php?name=aa ...

Issues with Codeigniter Ajax Post functionality

Hey everyone, I'm working on implementing a simple voting system for comments using jQuery Ajax to avoid page refreshing when someone likes or dislikes a comment. Here is the jQuery code I have so far: $(document).ready(function(){ $(".vote-btn").cli ...

Navigating to the detail page following a POST request in RTK query: A step-by-step guide

In my React RTK-query form, I am facing an issue where after a POST request is made, the form should navigate to the next step. However, in order to do that, I need to obtain the id of the newly created record. The backend auto-increments the id and does n ...

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

What is the best way to transfer an XML file from a server to a device using HTTP POST method?

I am in the process of setting up a server that will run on PHP, and I need to create an app for both iPhone and Android devices to parse the XML data that is sent. The app will send requests such as login and sign-in, and I am looking for guidance on ho ...

Encountering a Route Not Found Error on Heroku with Node and Express Deployment

Once I deployed my app to Heroku, it started having trouble finding the API path that was set up in Express. The code runs perfectly fine on my local machine, but on Heroku, I keep getting a 404 - Page Not Found error. This is how the router is set up: c ...

Sending a POST request using Node.js Express: A step-by-step guide

Looking for help on sending a post request from node.js Express with data passing and retrieval. Preferably a straightforward method like cURL in PHP. Can anyone assist? ...

Angular observable will only receive data once during initialization

Currently, I am progressing through Moshs' Angular course where we are building a simple shopping page. Despite the tutorial being a bit outdated, I managed to adapt to the changes in bootstrap and angular quite well until I reached the shopping cart secti ...

Prevent Automatic Redirects When Using POST in Express.js

I'm building a simple web app using Node.js and Express 4, and I want to implement a "follow" feature. While inspecting the Github website, I noticed that it utilizes a form with a follow button which posts to the server to follow a user. This approach see ...

Extract the body.req object within a loop in a Node.js application

I'm looking to efficiently parse and save the body of a POST request using Mongoose in Node.js. Is there a way to use a for loop to accomplish this task, rather than manually saving every property? My ideal solution would involve something like: for ...

Error encountered while attempting to send a post request via Axios due to network

I am currently working on implementing a post request in my application using Axios. Unfortunately, I have run into some errors while trying to make the post request. Here is the code snippet for making the post request: onPostJson = () => { axios.po ...

"Successfully implementing AJAX POST functionality, but encountering issues where callbacks are not triggering

I have gone through numerous posts addressing this issue and attempted various solutions, however, none seem to work for me. My AJAX POST function correctly adds the email to my mailing list, but the success and error callbacks are not consistently firing, ...

Determine the domain for a POST method request

Is there a way to determine the domain of another website when receiving a POST request from it? For example, if helloworld.com sends a POST request to mywebsite.com, how can mywebsite.com identify that the request is coming from helloworld.com? I have a ...

Having trouble with jQuery AJAX POST request to PHP script for database updating not functioning properly

I am currently in the process of creating a small CMS system and am looking to incorporate AJAX and jQuery into it. Although the code works fine without using AJAX, I am facing issues with data not being passed correctly. The AJAX success message displays ...

Why does my express POST request result in an empty req.body in Node.js?

After confirming that my data is being passed correctly and the db connection is successful, I am facing an issue with my ajax request. Even though the success callback returns the id, my data seems to not be passing through properly. When attempting to a ...

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

The Ajax request fails to pass the value to the controller

I've spent the entire day debugging this method and I'm in need of some assistance. My goal is to make an API request and for each array it returns, I want to send a post request to my controller method. However, despite console.log showing the c ...

What is the best way to save information submitted through an AngularJS form into a database utilizing a CodeIgniter controller?

Currently working on a project using CodeIgniter, we are integrating PHP for the server side and AngularJS for the client side. The main goal is to store the name and ID of a User in our database. Below is the snippet of AngularJS code: <!doctype htm ...

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

Is it possible for me to customize the jQuery library?

Looking to make changes to the jQuery.post function in order to tackle the CORS issue. Having to write extensive code like below when using jQuery.ajax can be tedious: $.ajax({ url:'', data:null, type:'post', xhrFields ...

Exploring the intricacies of gathering network data using Selenium

When capturing network traffic on Selenium objects for HTTP post requests, the JSON string returned includes request headers but not the body parameters of the post message. Here's the code in question: host = "localhost" port = "4444" browser = r"* ...

The ajax POST method fails to trigger in a Node.js environment

Having an issue with the POST request. It's necessary for updating info without page reload. Below is my pug code: .tinder--buttons form(id="form1") button#love(type="submit") i.fa.fa ...

Transmission of data through POST method in Hypertext Transfer Protocol

When I send a POST request, how can I retrieve the value associated with the key "success"? Here is what I have tried: @app.route('/register', methods=['GET','POST']) def vid(): if request.method == "POST": firstname=reque ...

Issue encountered with Angular when making a post request, whereas there is no problem with J

I am attempting to send a post request containing information to a token Uri. This information should result in receiving an access token back from the token Uri once authorization is granted. I have successfully implemented this on a plain HTML page using ...

Issue with Nodejs Express redirection functionality

After clicking the login button, I encountered an issue where the page was not redirecting to the success screen despite all functionality seeming to work fine. Searching online for potential solutions proved fruitless. Update: The problem seems to stem f ...

Using ASP.NET MVC 5, connect JSON to the action parameter

I encountered a problem while developing a basic app using ASP.NET MVC 5. The issue arose when I attempted to convert JSON into an entity. Below is the code snippet: Entity public class PlayListViewModel { public PlayListViewModel() { Track ...

I am having trouble retrieving the Post values that were sent using jQuery ajax

UPDATE: After removing 'index.php' with .htaccess, I encountered a newly discovered issue which I am now working on resolving. UPDATE: Issue resolved! Turns out the problem was in the Javascript code: url: "/login/". It needed a trailing slash to work pro ...

Send a JSON form without using AJAX

Is there a way to send form data as JSON without relying on AJAX? I attempted changing the enctype attribute: <form enctype="application/json"></form> However, according to w3schools, this is not a valid value. The reason behind my query is ...

Node JS is optimized for handling multiple clients concurrently who are posting data

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') { ...

Data is stored in the database without the need to fetch it through the $_POST method

Can someone explain how the variables are being inserted into the database without using $_POST to retrieve them? Is this a new feature in php5 or am I just unfamiliar with this method? <!doctype html> <html> <head> <title>< ...

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

Transferring JSON data using $.post in Express/NodeJS

Below is the contents of my app.js file: var express = require('express'); var app = express(); var path = require('path'); var $ = require('jquery'); var nodemailer = require('nodemailer'); app.use('/static', express.static(path.join(__dirname, 'static' ...

What causes an Undefined array key error when using AJAX POST?

I am having trouble passing a text string to a PHP Variable using AJAX. Every time the POST request is sent, I see this error message: Warning: Undefined array key "mydata" Although the alert displays the correct value, the PHP page shows the ...

Handling a WCF POST request with JQuery resulting in a 400 Bad Request HTTP Response

I'm encountering an issue with my JQuery POST not being accepted by the WCF Service. Below is the JavaScript code for the POST: function jqueryPost() { var url = "/LoggingTest"; $.post(url, { message: "test message" }); } To handle the POST reque ...