Permalink
Browse files

fixed content-type issue with post

  • Loading branch information...
1 parent 4970936 commit b617e8dd41494bdc094cb99027a9994eac4ab001 @windley windley committed Feb 9, 2012
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -23,11 +23,11 @@
<!--
<div class="container-fluid">
-->
- <div class="brand"><img src="images/logo/32.png" align="left"/> Kynetx Event Console <small>version 0.9</small></div>
+ <div class="brand"><img src="images/logo/32.png" align="left"/> Kynetx Event Console <small>version 0.9a</small></div>
<ul class="nav">
<li><a href="#event" scroll><span>E</span>vent</a></li>
- <li><a href="#body" scroll><span>B</span>ody</a></li>
+ <li><a href="#body" scroll><span>A</span>ttributes</a></li>
<li><a href="#authorization" scroll><span>A</span>uthorization</a></li>
<!-- <li><a href="#headers" scroll><span>H</span>eaders</a></li> -->
<li><a href="#response" scroll><span>R</span>esponse</a></li>
@@ -495,7 +495,7 @@
<div class="row">
<div class="span8">
<fieldset>
- <legend>Atttributes</legend>
+ <legend>Attributes</legend>
<div class="clearfix">
<label for="raw">Attribute Name and Value</label>
@@ -907,11 +907,12 @@
-->
<div class="page actions fixed" id="actions">
<input type="submit" data-action="submit" class="btn primary" value="Raise Event"/>
- <input type="button" data-action="get" class="btn" value="GET"/>
+<!--
+ <input type="button" data-action="get" class="btn" value="GET"/>
<input type="button" data-action="post" class="btn" value="POST"/>
<input type="button" data-action="put" class="btn" value="PUT"/>
<input type="button" data-action="delete" class="btn" value="DELETE"/>
-
+-->
<div class="pull-right">
<input type="reset" data-action="reset" class="btn danger" value="Reset"/>
<input type="button" data-action="save" class="btn success defaults" value="Save Defaults"/>
View
@@ -426,7 +426,7 @@ window.addEvent('domready', function() {
document.getElement('input[name="ktoken"]').set('value', this.get('ktoken'));
document.getElement('input[name="domain"]').set('value', this.get('domain'));
document.getElement('input[name="type"]').set('value', this.get('type'));
- document.getElement('input[name="method"]').set('value', 'POST');
+ document.getElement('input[name="method"]').set('value', 'GET');
document.getElement('form[name="request"]').fireEvent('submit', new DOMEvent);
});
@@ -627,6 +627,10 @@ window.addEvent('domready', function() {
}
});
+ // [PJW] since we've disabled user selection
+ // default content type
+ headers['Content-Type'] = 'application/x-www-form-urlencoded';
+
// validate headers
custom.headers.keys.each(function(key, index) {
if (unsafe.contains(key.toLowerCase())) {
@@ -650,9 +654,10 @@ window.addEvent('domready', function() {
return false;
} else {
// special condition for encoding
- if (request.encoding) {
- request['Content-Type'] = request['Content-Type'] + '; charset=' + request.encoding;
- }
+ //if (request.encoding) {
+ // request['Content-Type'] = request['Content-Type'] + '; charset=' + request.encoding;
+ //}
+
var schema = "http://";
var api_version = "sky";
@@ -665,7 +670,9 @@ window.addEvent('domready', function() {
request.type
];
var esl = schema + esl_components.join("/");
- console.log("Raising " + esl);
+// var esl = "http://www.postbin.org/sj7ta2";
+ console.log("Raising " + esl + "with " + request.method);
+ console.log("Attributes " + JSON.stringify(request.data));
var options = {
'url': esl,
@@ -755,7 +762,8 @@ window.addEvent('domready', function() {
//'Accept-Language': 'en-US,en;q=0.8',
'Connection': 'keep-alive',
//'Content-Length': '34',
- 'Content-Type': 'application/xml',
+// 'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8',
+// orig 'Content-Type': 'application/xml',
//'Cookie': '__qca=P0-2074128619-1316995740016; __utma=71985868.1147819601.1316995740.1317068965.1317073948.4; __utmc=71985868; __utmz=71985868.1316995740.1.1.utmcsr=(direct)|utmccn=(direct)|utmcmd=(none)',
//'Host': 'www.codeinchaos.com',
'Origin': 'chrome-extension: //kynetx-event-console',
@@ -205,6 +205,7 @@ var RESTRequest = this.RESTRequest = new Class({
} else if (this.options.raw != undefined) {
xhr.send(this.options.raw);
} else {
+ console.log("Sending " + JSON.encode(data));
xhr.send(data);
}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b617e8d

Please sign in to comment.