New answers tagged

0 votes

How to get the CSRF token when using a cross-origin REST API?

It does protect against CSRF. Logging in proves the user knows his credentials. You can embed those CSRF tokens in the result of logging in. The only way that could be fooled would be a service that ...
user avatar
  • 2,463
0 votes

REST API vs upserts and "updeletes"

Without knowing your requirements completely it's hard to tell but my feeling is that you want something like One table for the unique (determined by hash) set of fields A list of users that have ...
user avatar
2 votes

REST API vs upserts and "updeletes"

Change your table. Make one row per user and get rid of this weird hash thing. CREATE TABLE IF NOT EXISTS better_some_table ( id INTEGER GENERATED ALWAYS AS IDENTITY NOT NULL PRIMARY ...
user avatar
  • 4,021
0 votes

Saving REST API IDs into a different microservice

I guess there must be some kind of mapping service which, given an email or a phone number, returns the user ID to use for the REST calls? Where should this translation service be exposed? In the ...
user avatar
1 vote
Accepted

Handling a numerical value that may be specific or a range in a REST API

This may very well depend on how your API is to be used, and how the "width" property of these objects is consumed, so without knowing specifics, I can only give a general recommendation. I ...
user avatar
2 votes

Saving REST API IDs into a different microservice

Is it good practice to save the user id for a user in the orders microservice (that is, in the database that backs the microservice)? (or, in the general case, the ID of an object managed by a ...
user avatar
  • 38.3k
3 votes
Accepted

Best method to differentiate between two REST methods with the same pathparam (in Quarkus)

This is a matter of technical constraint and the cost of trying to overcome it (and whether it's worth it). Generally speaking, a given path should go to a given endpoint. However, some API frameworks ...
user avatar
  • 38.3k
4 votes

REST API Sub-Resources

To begin: "sub-resources" aren't really a thing in REST. Resources are "information that can be named" (Fielding, 2000) or "whatever might be identified by a URI" (RFC-...
user avatar
0 votes

REST API Sub-Resources

As Robert states in his answer, it depends. Design to your requirements. REST says very little about such details, intentionally. However, it does make one strong statement along these lines, with ...
user avatar
  • 10.5k
0 votes

REST API Sub-Resources

Curiously the answer to this is the same answer I usually do for object-orientation related questions. That is: It depends on the behavior. Unless you are a database that just serves dumb data (in ...
user avatar
-1 votes

Web API: REST-ish pattern for flexible querying of time-series data

Check the Prometheus API: https://prometheus.io/docs/prometheus/latest/querying/api/#expression-query-result-formats They designed their query-endpoint to accept GET (for simple queries) and POST (for ...
user avatar
0 votes

REST API partially incorrect request handling

Laiv suggest that this is a question to be answered by the business expert (domain experts or business analysts), which is the correct approach in my opinion. My answer is somewhat theoretical; it may ...
user avatar
  • 16.5k
0 votes

REST API designing resources for complex entities

how should one design REST resources based on multiple relational entities without creating endpoints for every single entity. You shouldn't. REST resources are not database rows and shouldn't be ...
user avatar

Top 50 recent answers are included