Commit 15059a34 15059a346a9f7379ffe58c9388aa2e081d5b825e by Nicolas Perriault

git ci -a -mrefs

1 parent 3d2cbd5f
...@@ -760,10 +760,16 @@ Casper.prototype.mouseEvent = function mouseEvent(type, selector) { ...@@ -760,10 +760,16 @@ Casper.prototype.mouseEvent = function mouseEvent(type, selector) {
760 }; 760 };
761 761
762 /** 762 /**
763 * Performs an HTTP request. 763 * Performs an HTTP request, with optional settings.
764 *
765 * Available settings are:
766 *
767 * - String method: The HTTP method to use
768 * - Object data: The data to use to perform the request, eg. {foo: 'bar'}
769 * - Array headers: An array of request headers, eg. [{'Cache-Control': 'max-age=0'}]
764 * 770 *
765 * @param String location The url to open 771 * @param String location The url to open
766 * @param Object settings The request settings 772 * @param Object settings The request settings (optional)
767 * @return Casper 773 * @return Casper
768 */ 774 */
769 Casper.prototype.open = function open(location, settings) { 775 Casper.prototype.open = function open(location, settings) {
...@@ -809,7 +815,8 @@ Casper.prototype.open = function open(location, settings) { ...@@ -809,7 +815,8 @@ Casper.prototype.open = function open(location, settings) {
809 this.log(f('opening url: %s, HTTP %s', this.requestUrl, settings.method.toUpperCase()), "debug"); 815 this.log(f('opening url: %s, HTTP %s', this.requestUrl, settings.method.toUpperCase()), "debug");
810 this.page.openUrl(this.requestUrl, { 816 this.page.openUrl(this.requestUrl, {
811 operation: settings.method, 817 operation: settings.method,
812 data: settings.data 818 data: settings.data,
819 headers: settings.headers || {}
813 }, this.page.settings); 820 }, this.page.settings);
814 this.resources = []; 821 this.resources = [];
815 return this; 822 return this;
......