From tsedovic at redhat.com Wed Aug 19 15:18:57 2015 Content-Type: multipart/mixed; boundary="===============1007262060526188006==" MIME-Version: 1.0 From: Tomas Sedovic To: aeolus-devel at lists.fedorahosted.org Subject: Re: Catalog/catalog entries json resposne Date: Thu, 15 Sep 2011 11:17:00 +0200 Message-ID: <4E71C28C.2090105@redhat.com> In-Reply-To: 1316070164-2972-1-git-send-email-jprovazn@redhat.com --===============1007262060526188006== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable On 09/15/2011 09:02 AM, jprovazn(a)redhat.com wrote: > Sending rebased version > > _______________________________________________ > aeolus-devel mailing list > aeolus-devel(a)lists.fedorahosted.org > https://fedorahosted.org/mailman/listinfo/aeolus-devel Hi Jan, As a side note, please make sure that you set the subject of the = patch-accompanying email to contain the string 'PATCH'. There was a previous discussion where we decided to do than instead = splitting this mailing list in two. People interested only in the = discussion can filter the patch emails out. The patchset looks great but I can't get it to respond with JSON data. = Which is more confusing as the tests pass and they seem to be checking that. I tried it with (cookie-authenticated) cURL request: $ curl --header "Accept: application/json" --header "Cookie: = _session_id=3D" -v http://localhost:3007/catalogs * About to connect() to localhost port 3007 (#0) * Trying ::1... Connection refused * Trying 127.0.0.1... connected * Connected to localhost (127.0.0.1) port 3007 (#0) > GET /catalogs HTTP/1.1 > User-Agent: curl/7.21.3 (x86_64-redhat-linux-gnu) libcurl/7.21.3 = NSS/3.12.10.0 zlib/1.2.5 libidn/1.19 libssh2/1.2.7 > Host: localhost:3007 > Accept: application/json > Cookie: = _session_id=3DBAh7CiIPc2Vzc2lvbl9pZCIlYWVhMTFlZmEwZWU4NDgxZThlZTU1NWEyZWE4Y= zZmYTUiGXdhcmRlbi51c2VyLnVzZXIua2V5aQYiF2phdmFzY3JpcHRfZW5hYmxlZEYiEGJyZWFk= Y3J1bWJzWwAiCmZsYXNoSUM6JUFjdGlvbkRpc3BhdGNoOjpGbGFzaDo6Rmxhc2hIYXNoewY6C25= vdGljZSIWTG9naW4gc3VjY2Vzc2Z1bCEGOgpAdXNlZG86CFNldAY6CkBoYXNoewA%3D--518f90= 6b8169106de0ba16ab4f702427356a0108; = path=3D/; HttpOnly > < HTTP/1.1 200 OK < X-Ua-Compatible: IE=3DEdge < Etag: "db37154245440b0afcffcf37d056964a" < Connection: Keep-Alive < Content-Type: application/json; charset=3Dutf-8 < Date: Thu, 15 Sep 2011 09:08:35 GMT < Server: WEBrick/1.3.1 (Ruby/1.8.7/2011-06-30) < X-Runtime: 1.234250 < Content-Length: 9516 < Cache-Control: max-age=3D0, private, must-revalidate < Set-Cookie: = _session_id=3DBAh7CyIQX2NzcmZfdG9rZW4iMWYraHZjUmtrdDl4ODRvVzBuc2JIczF2RStMO= DkyT280dlZESnF2M29JUFU9Ig9zZXNzaW9uX2lkIiVhZWExMWVmYTBlZTg0ODFlOGVlNTU1YTJl= YThjNmZhNSIZd2FyZGVuLnVzZXIudXNlci5rZXlpBiIXamF2YXNjcmlwdF9lbmFibGVkRiIQYnJ= lYWRjcnVtYnNbBnsJOgpjbGFzcyINY2F0YWxvZ3M6DnZpZXdzdGF0ZTA6CW5hbWVADzoJcGF0aC= IOL2NhdGFsb2dzIgpmbGFzaElDOiVBY3Rpb25EaXNwYXRjaDo6Rmxhc2g6OkZsYXNoSGFzaHsGO= gtub3RpY2UiFkxvZ2luIHN1Y2Nlc3NmdWwhBjoKQHVzZWRvOghTZXQGOgpAaGFzaHsGOwpU--bd= a0cce974fb10820445174849d1760870866e5d; = path=3D/; HttpOnly < Aeolus Conductor ... The interesting thing to note here is that the server actually sets the = "application/json" content-type but still returns the HTML page in the body. I tried it in the jQuery console as well with the same results: $.ajax('/catalogs/1', { dataType: 'json', success: function(d) { = console.log(d) } }) This results with the jqXHR object showing "parseerror" statusText and = the response is HTML again. Thomas -- = No trees were killed to send this message, but a large number of = electrons were terribly inconvenienced. --===============1007262060526188006==--