Click here to Skip to main content
15,886,788 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am very new to code but am trying to get through the basics as quickly as I can. I have been landed with a project that I have very little idea how to implement. I have several websites which I have done, but I need to implement a page that can access a RESTful API using the HTML GET method and JSON to retrieve data based on visitors selections which are automatically submitted to the REST using my API code. I have never done this before, I have a very limited knowledge on JavaScript and have a passion to learn but unfortunately I have a time restraint to finish this.

I was advised by a friend that you folks are very accomodating to assist beginners like myself. From what I can see in the documentation I was supplied with the API code that the requests are made to a uri with certain perimeters that specify what you want to retreave from the REST.

If there anyone that has some code that I could adapt by placing my API code in the .cfg file and then modifying the relavent perimeter areas to GET data?

Assistance would be greatly appreciated


Vincent
Posted

1 solution

Hi, basically what you want is a JavaScript code that would send a request to some web API and receive a JSON response.
First I'm not sure if your sites already use some JavaScript library, for example jQuery, in case they do then note that there are quite a lot of samples showing how to do accomplish this [^].

Now in case you are looking for a plain JavaScript solution (without any additional libraries) then you would need something like this.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900