Users will be able to share images in my project. But let's say that user1 has already shared the image to user2, but user1 tries to share the picture again to user2. What would be the appropriate status code for "already shared"?
Which status code to use when an operation has already been done?
283 Views Asked by StickDr At
2
There are 2 best solutions below
0
Keegan Murphy
On
I do not believe there a standard convention for this scenario. Status code 409 would highlight the fact the request was 1. Received and understood and 2. There was a server side conflict with processing and storing the data. Some other options would be 400, 403, and 422, but those could mean a variety of other issues with the request that could be misinterpreted.
Related Questions in HTTPS
- HTTPS configuration in Spring Boot, server returning timeout
- HTTP Requests from SSL Secured(HTTPS) Domain Failing
- My VPS does not accept HTTPS requests on a port other than 443
- Let Artifactory use HTTPS settings
- How to move updates from Google Play to another server
- Does a 403 error occur if there is no user-agent on the proxy network?
- How to fix HTTPS on express-gateway
- Can we check whether s3 bucket is currently accessed via http in any 1 of the account
- java.lang.UnsatisfiedLinkError: org.apache.tomcat.jni.SSL.renegotiatePending(J)I
- How do I fix this "Internal Server Error" I keep getting?
- Permission denied error on pfx certificate in docker ASP.NET Core 8 HTTPS on Ubuntu
- Mac Sonoma 14.4 Dotnet 8.0.203 SDK webapi https error
- Connect to wss that uses the same port as the rest of backend using nginx
- TLS: failed to verify certificate: x509: cannot validate certificate for <IP> because it doesn't contain any IP SANs
- Preventing Data Tampering in HTTPS Requests: Safeguarding User-Initiated Donations
Related Questions in SERVER
- Sending data from C++ server to React.js client
- Deploy Flutter and Laravel php mobile app on the host server
- Protect Server Actions with Next Auth in Next JS 14
- Cannot interact with netcat server over distance
- Facing fatal errors while running "yum update" command on CentOS 7/Cloudlinux 7
- Is there any way to set a printer as default according with Active Directory Policy Security Group and PC hostname?
- How to run GRPC and REST server on same port in Go?
- Share files from the server without data or internet usage
- Django Not Sending Tasks to Celery in Production
- Install Postfix Mail Server
- Is it viable proxying all my mobile apps requests, to some kind knowing that a request is coming from a secure source
- How does a server handle multiple requests, and how does is know where to send which response?
- Trying to launch batch file from powershell, and immediately closes
- Apache: How can I redirect to a subfolder with a URL param but serve required content via the main URL?
- Developing on a remote server an app symfony
Related Questions in HTTP-STATUS-CODES
- Polly v8 - Retrying specific status codes using the PredicateBuilder
- How repeat a proxy server with a checksite after a failed
- How to handle 4xx status codes in auto-tests
- HttpStatusCode in Spring Boot 3
- What is causing my python script using Google APIs to throw a status code 3 & 6?
- HTTP response code when trying to associate an item with another but is already associated
- How does HTTP redirect work with HTTP methods?
- How to return status code 200 instead of 403 the default URL of my asp net framework application
- How to get status_code from an exception object
- appropriate HTTP status code for non-existent resources in REST API?
- axios give me error (POST /api/v1/users/token/refresh/ HTTP/1.1" 401 65) , How solve it?
- Does HTTP have a "not ready yet" response code?
- How to access http status in Azure Function v4
- Http Status must not be null error how to solve that error
- When loading an image in JavaScript fails, how can you retrieve the specific error or HTTP status codes?
Related Questions in STATUS
- Activity status in Node js
- Ticketstatus on DynamicsCRM updates on TFS Ticketstatus change
- Simple Python Server - How to prevent sending 304 on either end?
- Drawer component can't close or open if a redux status is passed through the component props, but works directly if called in handler funtion
- blank orders being generated in WooCommerce with no details and a pending payment status,
- Payment gateway status check for vending machine
- Rails + Stripe: Enum status stays nil after update and save
- Woocommerce custom order status with customized email notification
- Add a Cancel order button to WooCommerce My account View Order pages
- Send text in email depends on status of checkbox in WCF7
- Podman Container Created Status
- Obtaining varied results using the grep command
- WooCommerce Virtual products - Autocomplete orders after payment
- Target status of deployment group in azure devops shows offline most of the time even though server is running
- What causes exist status 2 error? (GOLang)
Related Questions in HTTP-PUT
- How can I make a PUT request to Trello API in rails project?
- how to tell dotnet core version 7 UserManager to update it's security certificate to a new key
- Webhook vs HTTP POST/PUT?
- PUT vs POST - correct response code if already completed
- Angular http put request does not work and gives me an error 500
- Shall is use PUT for updating all 100 Fields in Employee table and Patch for updating 99 Fields?
- IIS Rewrite for asp.net core,HTTP_METHOD unuse?
- Django with Javascript fetch API: POST works but all other unsafe methods are forbidden
- JavaScript web server receive PUT requests
- Axios PUT request with header payload and Basic Authntication fails
- Upload file at pre-signed URL using HttpPut method contains extra unnecessary part
- DbContext Update vs EntityState Modified
- How to perform HTTP Put Request in Python like C# HttpClient
- HTTP DELETE and PUT methods are showing during http OPTIONS method request even after disabling
- How can I have my HTTP PUT routes treated the same way as PATCH routes?
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
409 is the right status code. It means the item already exists.
In your case
"image already shared"https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/409