Support Topics Documentation Slack YouTube Blog

UiKit and Json File

(Phil) #1

I’m trying to make an autocomplete textbox on my site. I’m using the autocomplete component on UiKit. I can reference their json file at: and it works.
However, I created the exact same file and hosted it here: and it doesn’t work. In Chrome, I get the following error:
jquery-1.11.1.min.js:4 POST 400 (Bad Request)
send @ jquery-1.11.1.min.js:4
ajax @ jquery-1.11.1.min.js:4
request @ autocomplete.min.js:2
handle @ autocomplete.min.js:2
(anonymous) @ autocomplete.min.js:2
a @ uikit.min.js:2
setTimeout (async)
(anonymous) @ uikit.min.js:2
dispatch @ jquery-1.11.1.min.js:3
r.handle @ jquery-1.11.1.min.js:3
Any idea what could be wrong?
Thank you.

(Mark Piller) #2

Hi Phil,

For the files hosted in the file storage of your app the only operation you can do is GET. When your script sends a POST request to the file, does it expect that the file (script) will do something with the request?


(Phil) #3

No, I don’t believe so. I’m not sure I can specify a GET request instead of a POST. So, I’ll basically have to use something other than the UiKit component if I can’t change it to a GET request?

(Mark Piller) #4

If all it needs is to fetch data, then it must use GET. Sending a POST request is incorrect for that use-case.