Wikipedia:Reference desk/Archives/Computing/2023 April 17

= April 17 =

HTML POST Request
I am trying to send a HTML post request with this code: function offer(userid, address, startTime, endTime) { function onSuccess {        console.log("offer was successfuly added"); }    var offerUrl = BASE_URL + "orders" + "?userid=" + userid; console.log("Sending POST to " + offerUrl); console.log(userid + address + startTime + endTime); $.ajax(offerUrl, {            type: "POST",             data: {address: address, startTime: startTime, endTime: endTime},             success: onSuccess,}) }

The code looks like it should work, but I cant get the destination page to say anything other than. The Url I'm trying to use is: http://137.108.68.13/openstack/taxi/orders?userid=2

So, could you please offer me some assistance in this matter? Thank you. 2A00:23C5:B23A:ED01:F134:1DF9:2DF5:59AE (talk) 16:37, 17 April 2023 (UTC)


 * I'm not a developer so maybe this is bad advice but whenever I've done anything like this, I've always found it best to use and intercepting proxy like Burp or others I can't remember the name of. Then you can see what is actually being sent to the server rather than just guessing from your code and the server's responses. While to be fair this can also have unexpected complications especially with Cloudflare and maybe some other advanced bot detection systems at least you can get some idea is what's going on. Nil Einne (talk) 02:39, 18 April 2023 (UTC)

Does BASE_URL end in a slash? --jpgordon&#x1d122;&#x1d106;&#x1D110;&#x1d107; 23:48, 19 April 2023 (UTC)