Questions tagged [url]
The url tag has no usage guidance.
51
questions
0
votes
0
answers
62
views
What's a good way to represent CRUD urls that require a parent id to work?
My website deals with states, which contain regions. So there will be a page called /states that lists states, and if you click on one, you get /state/{id}.
Note 1: This is not a REST endpoint, but an ...
0
votes
1
answer
1k
views
Can I use POST request to read and transform data?
I'm developing an API that given a few parameters, reads the given data, transforms it and returns it as JSON.
Eg. (some logic included)
Request:
POST /myApi/exportAsText
Content-Type: application/...
5
votes
3
answers
6k
views
REST API Design: Should the update (PUT) request include the ID in the resource URL?
When designing a REST API for update request. Usually PUT is used. Question: should the resource URL include the id usually?
For instance, there is a book resource: http://localhost:8080/library/book
...
4
votes
0
answers
868
views
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 ...
0
votes
2
answers
522
views
Why don't URL shortening services just use an always incrementing number as the short URL?
It seems like the URLs are always Base encoded yielding a short string instead. Wouldn't it be easier from a design perspective to just use a number instead? Sure your urls could be "browsed"...
-2
votes
2
answers
258
views
How can one choose between consistency and availability if the system you are designing is Tiny URL
I am putting together a system design for something similar to Tiny URL. It provides an API for mapping a URL to a short URL. Once created the short URL can be used to access the original URL. This ...
1
vote
2
answers
295
views
URL shortening : data partitioning
I've been looking in many places about this question - most top Google search results are copy-pasted from a single source, and others are not particularly helpful. Not sure if I am allowed to include ...
0
votes
1
answer
72
views
How should I represent a UI state change in the URL?
My web application has a UI. Some aspects of the UI can be changed (e.g. the language, the theme, the text size). As a concrete example, let's assume that I have a "theme" dropdown box available on ...
-2
votes
2
answers
400
views
Alternative to RLE for short, infrequent runs
I have 3 number arrays that I need to encode into a URL through query parameters. Example:
http://localhost:3000/?r=133223333302302040&y=10000000000000000000&b=13333332002100122331
This is a ...
6
votes
3
answers
3k
views
How to deal with long URLs in comments that exceed the 80 characters limit?
I generally try to adhere to the 80 character limit for each line of code to satisfy my colleagues, to satisfy the linting tools, and to maintain an image of professionalism when random people look at ...
2
votes
0
answers
118
views
mod_rewrite should I define a url prefix for assets?
I am working on a little framework where I have this directory tree:
project/
|--- ... (directories unrelated to the question)
|--- public/
| |--- index.php
.htaccess
The .htaccess sends every ...
1
vote
3
answers
358
views
If URLs are broken, and how to fix them
I have been having trouble clearly defining/specifying how a URL/URI should be applied to situations such as search queries or different resource formats. The question is what an actual "uniform ...
3
votes
2
answers
1k
views
Proper URL structure in REST API to change status of one particular record
What's the proper URL structure in REST API for changing state of one particular record (e.g. change from "new" to "processed").
Now I work with this URL without request body:
PATCH /employees/123/...
0
votes
1
answer
239
views
Trade-offs between explicit or implicit account id in a REST route
Please consider the following example (common in SaaS applications):
This is a SaaS that deals with Widgets.
You have an Account, that you authenticate via an API key. Each API key authenticates ...
2
votes
1
answer
287
views
Is the URL 'users/new' RESTful?
I was in a job interview demo-ing a RESTful API in Flask when an argument broke about the API. The interviewer argued that the URL for adding a new user (/users/new) is not proper REST.
My API ...
0
votes
1
answer
215
views
Is a URC (Uniform Resource Citation) synonymous with a Query String or Url Parameters?
Reading this:
https://renenyffenegger.ch/notes/development/web/URI-URL-URN-IRI-URC
URCs provide a set of attribute/value pairs that describe properties of URIs like authorship, publisher, ...
5
votes
2
answers
778
views
Should ID be given in URL if already secured with JWT containing ID?
Say I have the endpoints:
/users
and
/users/<id>
If I wanted to DELETE a user authenticated with a JWT token that contains the user object, should this DELETE handled go under /users or /...
3
votes
2
answers
2k
views
How to convey with an URI what is content type of the resource?
I would like to use URIs to represent different files we can use in our system. But to know which module to use to parse it, it would be great if I could somehow encode what is content type of the ...
2
votes
1
answer
913
views
How to reverse engineer URL routes from a bulk of HTTP requests/responses
I am building a web application crawler that crawls for HTTP requests (GET, PUT, POST, ...). It is designed for one specific purpose; bug bounty hunting. It enables pentesters to insert exploit ...
9
votes
2
answers
4k
views
Should I configure my URLs with a leading and/or trailing slash?
Maybe too basic of a question but wanted to see if there is more to it than I am thinking.
When configuring URLs (baseUrls, like https://my.app or relative URLs like /path/to/resource) either as a ...
49
votes
2
answers
77k
views
REST API Design: Multiple calls vs. single call to the API
We are developing a Rest API for eCommerce website which will be consumed by mobile apps.
In the home page of an app we need to call multiple resources like Sliders, Top Brands, Best Selling Products,...
0
votes
3
answers
1k
views
How to generate URLs for a custom URL shortener?
Due to some issues with other shorteners like goo.gl (disabling my links for example) I want to create my own URL shortener.
I am looking to have a single table that will contain the following columns ...
4
votes
2
answers
359
views
Should a web application be aware of its URL, including its sub-directory?
Let's say I have a reverse proxy set up getting traffic at http://gluten-free-snacks.example.com. It serves different URLs by sub-directories, not sub-domains, for a better web UX.
Its default ...
-1
votes
1
answer
454
views
How can I translate an ip address to a url in a Java Webserver?
I host my own webserver through Java. The problem is I can only access it through a web browser by using an ip address. Can I spoof a url? For example, I type in 192.168.2.111 into the address bar,...
1
vote
1
answer
229
views
When designing a URL router, is there a reason why some frameworks choose a configuration file vs. a naming convention?
I'm confused about routing. In some systems I've seen only naming conventions. In other's I've seen configuration, and in some I've seen both options (like in ASP.NET MVC5).
In the naming ...
6
votes
2
answers
56k
views
What is the correct way to pass JSON objects in an http request when a GET request is most appropriate?
One scenario is when you're creating a search endpoint. In the example below, I want to search a database of companies and the queries can become complicated; enough where I want to have the ...
2
votes
2
answers
1k
views
ID's in resource URLs: database id or per-user id?
For REST interfaces or webapps with nice-looking URLs, I constantly ask myself on what numbers to use if we want to refer to specific resources/pages.
A typical approach seems to be to use the unique ...
0
votes
0
answers
37
views
How do I structure a URL with several querystring items? [duplicate]
I have a URL like this http://myserver/controller/action/var1/value/var2/value...
Instead of ?var1=value...
Is putting the variable name and value like that a good way to do this? I'm using a ...
16
votes
2
answers
8k
views
Should I specify the userId in the REST URL structure?
Basically, one feature of my app is to retrieve the logged user's friends.
Actually, I hesitate between both kind of endpoints:
GET /api/users/friends
GET /api/users/:userId/friends
Using 1, ...
2
votes
2
answers
2k
views
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/...
8
votes
1
answer
47k
views
When passing dates/datetimes as url parameters in an API, which format is better - unix timestamp or date string (ISO 8601) [closed]
Interesting question came up at work in regards to the better format of passing a date/datetime as a url parameter in an API: Is it better to pass as a unix timestamp, or as a plaintext date string (...
1
vote
1
answer
4k
views
MVC URL structure with URI parameters
When creating routes for your MVC web application I have seen two possible ways to pass variables to a controller method:
With the first approach the variable is passed to a parameter of the ...
1
vote
3
answers
5k
views
URLs in javascript in the browser
We are trying to continually improve our source code base and a question came up recently which throws open a new area to improvement. Where best to put URLs that are needed in JavaScript?
Do we put ...
4
votes
1
answer
13k
views
Different operators in query string like ?var!=value
This one may actually be 2 questions in one.
Studying some APIs I came across an api suggesting to have operand different from equal (=) inside the query string (http://www.salesboard.com/api/):
...
0
votes
1
answer
2k
views
Good practice to pass this information through URL parameter
Basically, let's suppose an application that manage some user's meetings.
I have a filtering zone on a page that aims to specify the category of items I need to specifically return.
...
0
votes
0
answers
55
views
Redirection methods for webpages
(This is question involving user experience, but I am primarily interested in the best practice technical solution to this common problem.)
There are several places in my website where users are ...
3
votes
3
answers
3k
views
Is is OK to use a non-primary key as the id in a rails resource?
I am getting ready to set up a resource for some new api calls to my rails application.
I am planning on calling the resource devices ie
resources :devices
This is going to represent android mobile ...
2
votes
1
answer
80
views
Webservice Design: benefits of piping use-cases to URL rather than using search param's, or vice versa?
I've gotta build a webservice for employee information, and I'm trying to plan it out.
To clarify, we already have a REST-ish service for People and a separate REST-ish service for Companies.
This ...
4
votes
1
answer
224
views
In what URL segment do you have language? /en/admin/dashboard or /admin/en/dashboard? [closed]
maybe you are thinking that this is another dump question about language in URL, but I hope it is not! I've red many articles on this, but non of them was dealing with "sections of site" (described ...
2
votes
3
answers
172
views
HasMany RESTfull Implementation
So I've been reading a lot on RESTfull design - specifically dealing with resources.
Taking the canonical example of Users, Posts, and Comments, with relationships as:
Users ---(hasMany)---> Post -...
25
votes
2
answers
11k
views
Levels of user permissions in a RESTful API
Let's say I have a company that ranks the cutest cats on the internet.
I offer a resource at /cats/ which provides users with the latest, cutest adorable cats.
Users can either get just the top 3 cats ...
0
votes
3
answers
733
views
URL Naming Convention with Repetitive Letter
What is a good practice to name an URL if it contains repetitive letters. For example, /info/foossite
The two s looks kind of odd and if this was access point for a Web-Service, this could lead into ...
6
votes
5
answers
746
views
When did the first "REST"-model and friendly URL web technology come to be?
Everyone knows that the "current" way to do things is to have user-readable URLs. Like:
http://example.com/blog/edit/1234
Rather than:
http://example.com/blog.php?action=edit&id=1234
When ...
2
votes
1
answer
2k
views
Creating a site just for URL redirecting (.NET MVC) due to changing domains and URLs
I'd just like to hear about any experience creating a (simple) site for redirecting requests.
Basically we have multiple domains, but as we add more domains and change URLs, there is a huge problem ...
1
vote
3
answers
5k
views
Pass around record ids in the url in PHP
I'm doing a PHP application with CodeIgniter and most of my controllers accept record ids as parameters for retrieving purposes.
I also pass record ids in my forms action.
Like this: www.sample.com/...
1
vote
3
answers
7k
views
Is path in Set-Cookie URL encoded?
I'm writing some code that sets cookies and I'm wondering about the exact semantics of the Set-Cookie header. Imagine the following HTTP header line:
Set-Cookie: name=value; Path=/%20
For with path ...
5
votes
2
answers
25k
views
Using double dot notation in URL link
I've recently been working on a project and I've been seeing two different forms of url's being used.
src="../MyLinkUrl"
and
src="/MyLinkUrl"
We are using MVC .NET and the times I have seen the .. ...
5
votes
5
answers
2k
views
Best way to protect website application code
Background
I have a web application that I host on my own server. I have clients who use the application as is, but some have asked if they can host the application on their own server. This enables ...
0
votes
2
answers
2k
views
add a prefix to localhost [closed]
Is there any possibility to add a prefix before localhost?
My question is that I want to add a prefix before localhost for my project url (ie. "dev.localhost/project/default.htm"). This is for an ASP....
3
votes
1
answer
1k
views
Should I implement slugs with my already fairly long URLs? [closed]
I'm considering implementing slugs in my blog. My blog uses MongoDB. One of the side-effects of using MongoDB is that it uses relatively long hex string IDs.
Example
before: http://lastyearswishes....