Skip to content

Tag: fetch-api

Get Reponse Code and JSON Response in Fetch

I have following Code to get the Response from the API. Now I want a response if the data are successfully send to the server. My first idea was to do it with the response code. If it is 200 it is successfull. The other idea is, to make it with a try catch statement. Getting the response from the

Convert CURL to javascript fetch

How can I convert the following CURL command to javascript fetch? I used the above command on my server is working. Then I throw this command to many online CURL to javascript fetch converters, and they all return only like this: The above fetch code is not working for me. and it returns Uncaught (in promise)…

How do I properly make click event on fetched “buttons”?

I fetch all users from database via this code After they fetched, I generate an element and add that element to the list. That works fine, but! I have this part of code In my logic, after elements generated, and window loaded, all items with class users__user-field must have a click event to toggle selected c…