1
1
123qwe2016-03-17 19:40:36
API
123qwe, 2016-03-17 19:40:36

What is meant by API implementation?

Create a gallery to view pictures.
The gallery must support:
1. Output of all pictures, preferably reduced ones. The file name should be written under the picture. When you click on the picture, it should open in full size, you can in a separate window.
2. Uploading pictures by the user. When uploading, it should be possible to select a category, or enter tags. Non-pictures should not end up in the gallery.
3. Displaying pictures in a given category. Select a category from the drop-down list.
Desirable:
4. Implement an API to get information about a picture by its ID in JSON format.
The information should contain the file name, its size in bytes, the size of the image in pixels, and a link to the image. The request form is arbitrary.
Example
request: gallery.local?picid=13
response: {"id":"13","filename":"serenity.jpg","size":"21315","width":"1024","height": "768"}
5. Implement an API to get information on existing categories and the number of pictures in them, in JSON.
Sample
request: gallery.local?categories
response: {"clouds":"12","horses":"3","cats":"2423794353"}
It is also desirable to implement all of the above using the MVC scheme.
4 and 5 task.
What exactly needs to be done?
Do I need to write my own custom API, or does this imply the use of restfull api?
In the example, the address bar tells you what to get. I'm wondering how that works.
I need answers and explanations)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mr4x, 2016-03-18
@Yonghwa

In this case 'custom API' == Restfull API. You need to make handlers on the server for the specified requests, which will return data from the database. The client provided you with a great example of the desired result. By request '?picid=' you take image data from the database and give it to the client, and by request '?categories' you display a list of categories.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question