Questions tagged [uri]
29 questions
30
votes
6 answers
What is a URI Scheme?
I have searched for this question, but I haven't found a good answer.
Even the Wikipedia Article on URIs does not explain it thoroughly. I thought it was the protocol for accessing a web page. e.g. HTTP/HTTPS/FTP, but the wiki article says…

b0yfriend
- 669
- 2
- 6
- 9
12
votes
2 answers
What is the argument for singular nouns in RESTful API resource naming?
I understand that when naming RESTful URI's it is commonly accepted to use plurals to represent collections of resources. I am curious as to the argument for using singular nouns instead.

charness
- 123
- 1
- 6
7
votes
2 answers
Why include IDs of parent resources in REST endpoint?
Say I have a company directory application, so Companies have Employees. It's pretty clear to me why you would have the following GET endpoints:
api/companies # Get all company records
api/companies/{id} # Get company with…

aparkins
- 81
- 2
6
votes
1 answer
How to design URIs to initate batch jobs in a RESTful service
If I want to run a job at the end of the month to calculate the commission for all the sales consultants based on the current transaction data, eg commission rate for the person, sales done in the month, and payments received from their customers,…

Johan
- 181
- 6
5
votes
5 answers
RESTful URI map to database tables?
When designing a RESTful API, should your URI map to tables (for the most part). I have 2 tables that look like this:
Users
+-----------------------------------+
|id|first_name|last_name|email|role |
+-----------------------------------+
|1 |Jonny …

keelerjr12
- 1,199
- 1
- 9
- 22
5
votes
1 answer
REST URI convention - Involves different resources
I am designing a REST API but came across some difficulties while naming it. I have an API like this:
GET .../users/{userId}/categories/count
GET .../users/{userId}/categories/{categoryId}/count
GET …

hades
- 151
- 4
4
votes
0 answers
Is there a conventional URI scheme for local sockets (AF_UNIX)?
I'm looking at creating a class which accepts a string to define a Unix socket address.
Linux supports three types of addresses for Unix sockets:
File based addresses (also called named domain addresses)
Abstract addresses
Unnamed addresses
The…

Alexis Wilke
- 241
- 1
- 7
4
votes
3 answers
Saving URI in database parsed vs plain
So I want to save different URIs in database.
I want format to be forced as well to look up different URIs easily.
Is it better to create table like this:
CREATE TABLE uris (
id INT(11) UNIQUE PRIMARY KEY AUTO_INCREMENT,
scheme VARCHAR(255) NOT…

8bra1nz
- 259
- 1
- 8
4
votes
2 answers
Why do XML namespace URIs use the http scheme?
A XML namespace should be a URI, but it can use any URI scheme, including those that are not URLs.
Then why do all widely used XML namespaces use the http scheme (e.g. http://www.w3.org/XML/1998/namespace), considering that trying to use the URI as…

svick
- 9,999
- 1
- 37
- 51
3
votes
1 answer
URI construction for REST API and use of verbs as resource?
I have two questions.
1) I have a issue of understanding the correct URL construction for a REST API. For example,
https://api.context.io/lite/users/id/email_accounts/label/folders/folder/messages/message_id
Here as you can see the folder comes…

Nalaka Hewapathirana
- 65
- 6
2
votes
3 answers
REST API: model file uploads as part of a resource or as subresources?
I am designing a REST API that has to deal with users and two video uploads associated to each user. So far, I've come up with two different approaches of modeling this:
Video as part of a user resource.
Video as a subresource of a user…

bk138
- 121
- 3
2
votes
1 answer
How to structure your URIs?
I am making a web UI and an HTTP API for editing JSON documents in collaboration (role and versioning system).
There are several types of JSON documents. Each type is described by a JSON schema, let us say:
schema_a, schema_b
Each user is assigned…

Géry Ogam
- 602
- 3
- 13
2
votes
1 answer
recommendations regarding resource uri
lets say we have a "door api" and I want to create a resource to close the door.
I could do this in 3 ways:
traditional way using PUT with payload {id: XX, color: YY, closed: true}
advantages: simple and follows standard
disadvantages: client…

masber
- 327
- 1
- 5
- 9
2
votes
2 answers
Web API: avoiding name conflicts in URL query parameters
I am implementing a REST-like API and have just faced an interesting problem. There is a need to provide a resource with an open list of query parameters to filter the results.
For example:
GET /api/items?field1=value1&field2=value2
Field names are…

pkalinow
- 689
- 7
- 13
1
vote
1 answer
How to represent/address content within multiple / different / stacked mime types?
I have a resource, let's say image.jpg. This image(along with other resources) is compressed in a .zip file (archive.zip) under the path /favimage/image.jpg. The archive is uploaded at http://example.com/down/archive.zip.
Now I want to address this…

mike
- 11
- 2