@nschutz ,
You are getting a list of courses, but Canvas puts a while(1); in the front of it since your browser hasn't told it that it can handle JSON results. The while(1); is not valid JSON and so the browser is complaining.
Here's what I get when I try the first request inside Chrome.
![266509_pastedImage_2.png 266509_pastedImage_2.png](https://community.canvaslms.com/t5/image/serverpage/image-id/27152iAFA8412F85286DE0/image-size/large?v=1.0&px=999)
Here's what I get when I try it in Firefox
![266510_pastedImage_3.png 266510_pastedImage_3.png](https://community.canvaslms.com/t5/image/serverpage/image-id/27153i959DABEE8612CC97/image-size/large?v=1.0&px=999)
Okay, that's not technically true. What I get is this:
![266511_pastedImage_4.png 266511_pastedImage_4.png](https://community.canvaslms.com/t5/image/serverpage/image-id/27154i655B164816BEE34D/image-size/large?v=1.0&px=999)
Recent versions of Firefox handle JSON and allow you to look at it in formatted JSON view or in Raw Data mode.
But ... but ... but ... I'm using Firefox, you say.
Okay, so what you're seeing is this error:
![266512_pastedImage_5.png 266512_pastedImage_5.png](https://community.canvaslms.com/t5/image/serverpage/image-id/27155iF3C2499CF7EB42FB/image-size/large?v=1.0&px=999)
If you switch to Raw Data, you'll see the while(1); at the beginning as I showed before.
The problem is that Firefox does not accept JSON responses by default and you need to tell it to do that if you want to do this kind of thing in your browser.
This is controlled by the network.http.accept.default setting. By default, it is set to
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Since that doesn't contain application/json, Canvas puts the while(1); in front.
What I've done is modified mine to include the application/json. Here's what mine looks like.
text/html,application/xhtml+xml,application/xml,application/json;q=0.9,*/*;q=0.8
You might be able to list the json before the xml, but I didn't want to risk breaking something and so I just added it to the end.
Now that I've explained the problem, the next question is how to fix it.
- Type about:config in the location (URL) bar.
![266513_pastedImage_14.png 266513_pastedImage_14.png](https://community.canvaslms.com/t5/image/serverpage/image-id/27156i15347D2396EDCAB1/image-size/large?v=1.0&px=999)
- Accept the risk of voiding your warranty
![266514_pastedImage_15.png 266514_pastedImage_15.png](https://community.canvaslms.com/t5/image/serverpage/image-id/27157i430E54D766BF7144/image-size/large?v=1.0&px=999)
- Search for network.http.accept.default in the search box
![266515_pastedImage_16.png 266515_pastedImage_16.png](https://community.canvaslms.com/t5/image/serverpage/image-id/27158iE8B83A6C5AECB192/image-size/large?v=1.0&px=999)
- Right click the mouse and choose Modify
![266516_pastedImage_17.png 266516_pastedImage_17.png](https://community.canvaslms.com/t5/image/serverpage/image-id/27159i8DD5AB41D08C10EF/image-size/large?v=1.0&px=999)
- Add ,application/json between the application/xml and the ;q=0.9
![266517_pastedImage_18.png 266517_pastedImage_18.png](https://community.canvaslms.com/t5/image/serverpage/image-id/27160i17DB9825FD4AB69F/image-size/large?v=1.0&px=999)
- Click OK
After going through that process, you can now refresh your page from Canvas and see a list of the courses nicely formatted. Once you start telling websites that you understand application/json, then Canvas stops putting the while(1); in there and it is recognizable JSON.
If you ever need to set it back to the default -- say because you want to show someone the steps of how to set it up like I did tonight, then click Reset in step 4.