Help get this topic noticed by sharing it on
Twitter,
Facebook, or email.
Twitter,
Facebook, or email.
appAPI.request.post Help
When using appAPI.request.post, I'm having trouble passing hashed values to my php script. $_POST is returning an empty array. Is any one else having this problem?
-
RNeldner,
Can you please paste us the piece of code that does the actual post request with the appAPI ?
Thanks -
-
thanks for the fast response : )
appAPI.request.post(
'http://rn.couponpal.com/coupons/ajax_...,
{ hello: "world" },
function(data) {
$('body').prepend(data);
}
); -
-
Couple of questions that will allow us to understand this issue better:
Are you doing this from debug mode ?
Which platform are you working on ?
Do you get an error from your server ?
Can you please c/p the server response ?
Thanks. -
-
Are you doing this from debug mode ?
No, I'll give that a shot and see if it helps.
Which platform are you working on ?
Firefox. The server I am calling uses Linux.
Do you get an error from your server ?
No, error.
Can you please c/p the server response ?
All I'm doing on the server side is printing out $_POST which is resulting in "Array ()" when prepended to the body element. I would expect to see something like "Array ( [hello] => 'world' ) as that is what I am passing to the server. -
-
-
-
Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.10) Gecko/20100914 Firefox/3.6.10
-
-
Can you please pass some parameters in the query string along side the POST request and let me know if you catch those from the server ?
For example:
appAPI.request.post('http://rn.couponpal.com/coupons/ajax_..., { hello: "world" },
function(data) {
$('body').prepend(data);
}
);
Do you see foo => bar on your server side ? -
-
-
-
Rnedler,
We have managed to reproduce this on our local testing environment, so we will work on a fix on this and let you know when we deploy it.
Sorry for the inconvenience. -
-
Rnedler,
Can you please let me know what you are getting when POSTing to this URL ?
http://crossrider.com/ajax/test_post
It's a simple action that echos back the request POST and GET params.
Thanks for your time. -
-
I recently updated my version of Firefox to 4 and now I'm getting this error in debug mode...
INTERNAL ERROR:
Line: -6277
POST FAILED - BAD SERVER/URL (http://crossrider.com/ajax/test_post) -
-
You get this error as the url (http://crossrider.com/ajax/test_post) is not available anymore (currently it returns 404).
I will make sure we will bring this test page back to the server and then it should work well for you. -
-
EMPLOYEE
I’m
sorry for the 404
My apologies Rneldner,
Its working now.
Please go ahead and give it a try again:
http://crossrider.com/ajax/test_post -
-
Still getting this error...
INTERNAL ERROR:
Line: -6272
POST FAILED - BAD SERVER/URL (http://crossrider.com/ajax/test_post)
Here is the post call I am making
appAPI.request.post(
'http://crossrider.com/ajax/test_post',
{hello: "world"},
function(data) {
if(data){
$(body).prepend(data);
}
}
); -
-
There was bit of miscommunication in here...
Crossrider's current version does not support hash as the post params.
The way to pass post params is like this:
appAPI.request.post("http://crossrider.com/ajax/test_post","hello=world&foo=bar", function(data) {
alert("POST SUCCESS");
alert(data);
}, function(e) {
alert("failed")
});
We will add this feature to our pipeline + there is quick fix we should apply to IE post as well.- view 1 more comment
-
-
Do you plan to make it jquery-compatible in the future?
-
-
I believe we will have to :)
It might take some time as it's not our top priority but it's in the list. -
-
-
-
Thanks again for your help!
This is working great in Firefox, however, if i pass the string params with the post using the Chrome browser, the call is failing. The function succeeds if i leave the string param empty (ie. '').
I am using the latest version of Chrome for Windows. -
-
I just checked it and it's working well for me.
I'm using Chrome on Mac but it's hard to believe this is the reason it's working for me and not for you.
Do you test it in debug mode? If yes, please download the latest version of your debug extension as we recently made a change (bug fix) to make it work well on Chrome. (your extension version should be with 1.6.xxx) -
-
Great! Updated my Chrome debug extension and it's working! Finally, I've moved onto IE. I am testing in IE 8 (debug mode). The call is being successfully made, however, the param values are not being received. Any changes that need to be made for IE?
-
-
I'm glad it's working well for you and I'm really sorry for the miscommunication earlier re how to pass the post param values.
There is currently a bug in IE which does not deliver the param values. This will be fixed soon (unfortunately, not this week) but you can continue developing your app as usual, as once this is fixed it will support the same api as Firefox and Chrome which you have already implemented (no code change for you).
btw, as a feedback for us: would you prefer to pass your post param values via hash or string? -
-
I think passing the post params as a hash is a little bit cleaner, but as long as its working one way or another, I'm happy! haha
Thanks for the IE heads up! -
-
Does appAPI.request.sync.post still work? I'm getting an alert error saying "appAPI.request.sync.post is not a function" when attempting to make this call in debug mode.
-
-
Are you trying this in Chrome?
Chrome browser does not allow sync requests and there is no way to bypass it :(
That means sync requests are only available for FF and IE browsers and in Chrome you will have to use async request. -
-
-
-
I'll double check this in FF4 later anyway in case you will need it
-
Yes, there is naming issue problem with FF4 with all appAPI.request.sync functions. Will solve it soon and deploy new version.
It's currently in low priority as in principal we don't encourage sync requests (for better user experience it's better to use async requests unless it's a must to use sync requests). Please let me know if you need it to your app and in that case I will change this ticket to high priority. -
-
-
-
-
Hi,
As promised, IE post params bug is fixed. It's now going through some QA testings before releasing it so I hope by early next week it will be out publicly.
Thanks again for reporting this bug :)
Best,
K. -
-
-
-
I forgot to update the release with the IE post fix is out there (really sorry about that).
We didn't put our auto-update for this release so you will have to re-install the exe.
This was tested and verified to be working. If it's not working please check at your Win registry (under Crossrider branch) that you have version 130 on both the BHO version and the Helper version. -
-
Hi,
I'm having the same problem - no post parameters.
this is my code:
appAPI.request.post(url,{ data: "marina", sessionId: "00000000-0000-0000-0000-000000000000"}, function(data) {
alert(data)
}, function(e) {
alert("failed")
});
I'm using firefox 3.6 and can't upgrade - because of some restrictions from other legacy system.
Thanks, Marina -
-
Marina,
Post currently doesn't accept hash but should be at the format of string (like get URL params), so I believe passing the params like this will work:
"hello=world&foo=bar"
Best,
Koby -
-
Hi,
POST parameters are still not supported? How can I send on my server big string (more 10000 string characters) -
-
SaSa,
POST parameters are supported!
This discussion refers to "POST parameters as a hash".
This means you can POST your long data to your server but currently only as as query string (and not a hash).
For example:
var myVeryLongData = "very long data";
var myurl = "http://crossrider.com/ajax/test_post";
appAPI.request.post(myurl,"mydata="+escape(myVeryLongData), function(data) {
alert(data)
}, function(e) {
alert("failed");
}); -
-
-
-
Hi,
I have a ajax api request like this
$.ajax({
url: 'http://xyz.de/_cms_demo/api',
type:'POST',
data:{ request:'offers_list_gen', params:{mandant_table:'some value'}},
success: function(data) {
var json = eval('('+data+')');
}
});
and I want to write this using appAPI.request.post
and I did
var url = '';
appAPI.request.post("http://xyz.de/_cms_demo/api?request=o... value'",function(data) {
var json = appAPI.JSON.parse(data);
alert('Successfully posted data to ' + json.output);
}, function(e) {
alert('Unable to post to url ' + url);
});
but It's not passing parameters as my api should receive therefore api is returning error message. Can you please help me in defining parameters in correct format -
-
Hi now i am trying to develop a plugin using cross rider,with this i want to post some url to my server but no data is recieving at the server side.
please help me-
Please open this in a new thread and provide the following information:
- The extension id
- The file/line number where the code snippet can be found
- Which browser and operating system you are testing on, including version numbers
- The exact steps for reproducing the problem
- Any additional useful data, such as URLs, screenshots, videos, ...
-
-
-
-
Loading Profile...




EMPLOYEE

EMPLOYEE

