Questions tagged [url]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
3answers
293 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 ...
1
vote
0answers
25 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
3answers
319 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
2answers
225 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
1answer
92 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
1answer
156 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
1answer
161 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, ...
3
votes
2answers
125 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 /...
1
vote
1answer
905 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
1answer
518 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 ...
6
votes
2answers
1k 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 ...
14
votes
2answers
21k 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,...
1
vote
2answers
932 views

Need advice on making my own 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 ...
4
votes
2answers
183 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
1answer
218 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
1answer
90 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 ...
4
votes
2answers
34k 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
2answers
930 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
0answers
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 ...
8
votes
2answers
4k 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
2answers
1k 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/...
5
votes
1answer
26k 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
1answer
3k 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
3answers
4k 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 ...
3
votes
1answer
4k 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
1answer
1k 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
0answers
52 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
2answers
2k 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
1answer
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
1answer
201 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
3answers
167 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 -...
23
votes
2answers
8k 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 ...
0
votes
3answers
682 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
5answers
718 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
1answer
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
3answers
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
3answers
5k 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 ...
3
votes
2answers
20k 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
5answers
1k 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
2answers
1k 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
1answer
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....
2
votes
2answers
402 views

How do we set a link to a Paid version of app if we don't have the app in App Store ?

If we don't have the free and the paid apps on the Apple app store yet, how would we program in the free version to link to the paid version because the link is not there yet? Do we have to have a ...