summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authorvadimt@chromium.org <vadimt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-13 02:39:22 +0000
committervadimt@chromium.org <vadimt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-13 02:39:22 +0000
commit910b78e22aa3c16db21d65b59d01d091e688a416 (patch)
tree2fa04bf3a9a636d9ae9ab7a79275cbf098eb144e /chrome
parent84bbd4a345b85000de018e3f7c6152940048d831 (diff)
downloadchromium_src-910b78e22aa3c16db21d65b59d01d091e688a416.zip
chromium_src-910b78e22aa3c16db21d65b59d01d091e688a416.tar.gz
chromium_src-910b78e22aa3c16db21d65b59d01d091e688a416.tar.bz2
Switching from GET to POST requests.
BUG=164227 TEST=no new test needed. Review URL: https://chromiumcodereview.appspot.com/13422008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@194076 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/resources/google_now/background.js18
1 files changed, 10 insertions, 8 deletions
diff --git a/chrome/browser/resources/google_now/background.js b/chrome/browser/resources/google_now/background.js
index 01c1271..55892c8 100644
--- a/chrome/browser/resources/google_now/background.js
+++ b/chrome/browser/resources/google_now/background.js
@@ -275,11 +275,12 @@ function requestNotificationCards(requestParameters, callback) {
};
request.open(
- 'GET',
- NOTIFICATION_CARDS_URL + '/notifications' + requestParameters,
+ 'POST',
+ NOTIFICATION_CARDS_URL + '/notifications',
true);
+ request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
tasks.debugSetStepName('requestNotificationCards-send-request');
- request.send();
+ request.send(requestParameters);
}
/**
@@ -290,7 +291,7 @@ function requestNotificationCards(requestParameters, callback) {
function requestNotificationCardsWithLocation(position, callback) {
// TODO(vadimt): Should we use 'q' as the parameter name?
var requestParameters =
- '?q=' + position.coords.latitude +
+ 'q=' + position.coords.latitude +
',' + position.coords.longitude +
',' + position.coords.accuracy;
@@ -351,7 +352,7 @@ function requestCardDismissal(notificationId, callbackBoolean) {
console.log('requestDismissingCard ' + notificationId);
recordEvent(DiagnosticEvent.DISMISS_REQUEST_TOTAL);
// Send a dismiss request to the server.
- var requestParameters = '?id=' + notificationId;
+ var requestParameters = 'id=' + notificationId;
var request = new XMLHttpRequest();
request.responseType = 'text';
request.onloadend = function(event) {
@@ -363,11 +364,12 @@ function requestCardDismissal(notificationId, callbackBoolean) {
};
request.open(
- 'GET',
- NOTIFICATION_CARDS_URL + '/dismiss' + requestParameters,
+ 'POST',
+ NOTIFICATION_CARDS_URL + '/dismiss',
true);
+ request.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
tasks.debugSetStepName('requestCardDismissal-send-request');
- request.send();
+ request.send(requestParameters);
}
/**