1,708 questions
0
votes
2
answers
316
views
HTTP status code for creating too many resources
If there is a limit on the number of resources created using POST request, what should be the status code?
Let's say, there is a restriction on the number of resources created using POST wherein only ...
1
vote
1
answer
943
views
How do I use HTTP status code enum as django model field choices?
I would like one of my django models to have a field like this:
status = models.IntegerField(choices=Status, max_length=20)
but instead it would take directly from the HTTPStatus class
In the mean ...
-1
votes
1
answer
220
views
What status code should I set when updating and reloading the website?
What status code should I set when updating and reloading the website for search engines to understand?
Currently, I use the code 503, but Google registers it as a site error!
0
votes
1
answer
790
views
Google Cloud Function Not Returning Error Message
I have the following code in a google cloud function. When the user account is created it returns status 200 and the name of the registered user which I can access from the return of the successful ...
1
vote
0
answers
539
views
How can you make appear a status code as a response of an html form using a javascript fetch?
I'm trying to create a form on html where you can enter a link (like: https://google.com) and when you submit it you can see the status code and see if there has been a problem or not.
My html code is ...
2
votes
1
answer
1k
views
Error codes on slack -- is this normal for an API? [closed]
In Slack, it seems almost every response is a 200 OK, for example:
Is this common in APIs, or is this considered bad practice, or there's really no standard in the real world for how APIs return a ...
0
votes
1
answer
101
views
According to vulnerability score scheme what score a Client Side DOS Attack can get?
For example I am testing a website and I found some invalid (error) pages. You visit the page and receive status code 500. But now if you reload the page or visit any valid page on website it just ...
0
votes
1
answer
1k
views
Http status code to status messages in C++
I have written a simple program using LibCurl that does some http stuff. I was wondering if there is any library with function that can convert http status codes to status messages or LibCurl has any ...
1
vote
0
answers
65
views
Check IMG URL status (PHP get_headers)
In a nut-shell, I am trying to display feeds from other sites, that sometimes have IMG elements. Ideally, these IMG should be loaded by an external proxy, such as Aratech or Weserv. In my code below, ...
2
votes
2
answers
1k
views
Pandas read_csv response codes when using an external url
I'm replacing requests.get() with pd.read_csv() and would like to write some exception logic if pandas does not get the equivalent of a status code 200.
With requests, I can write:
response = requests....
0
votes
2
answers
547
views
Which HTTP status should I return if the client tries to upload a new file while server is still processing the previous one?
My application has a button for allowing the user to upload a file. Uploading the file is very quick, we send the response to the client very quickly, but the service takes a while to process it.
The ...
0
votes
1
answer
209
views
Is it important to include status in Django?
I am working on project where I'm importing, parsing and showing JSON data on site. I wanted to ask if it's important to add in JsonResponse "status" attribute.
For example: return ...
1
vote
1
answer
374
views
Define multiple 2xx responses for the same endpoint/path
We have a GET endpoint, which does not always return data, and the idea is to define two 2xx responses:
If we have some data, then we return a 200 code with the response body.
If we don't have any ...
1
vote
0
answers
2k
views
Why does a 308 Redirect not automatically redirect to the URL in location as 301/302 do?
I have a BOT that scrapes certain data and sometimes they get their pages wrong e.g for two different times they will have a different no of items but the same main info date/time/place etc.
I log all ...
0
votes
1
answer
867
views
Which is the proper response code for this scenario - 207 vs 400 status code
I am designing the API where all the following three cases are possible
All the inputs in the array are correct, so this API will return the 200 status code
Sample output: 200 Status code
[{ "...
1
vote
0
answers
478
views
Http response for no results
I've done a fair bit of research, but I can't find anything conclusive on what HTTP response to send in the case that there are no results to be returned.
Ie. The request was correctly formed, no ...
1
vote
1
answer
5k
views
Restsharp polly retry policy based on status
I am trying to manipulate polly retry policy based on response status code.
If status code is 500, I need to retry after 3 minutes else I need to retry after 2, 4 seconds.
I have something like this ...
0
votes
1
answer
86
views
HTTP API development: what should be the HTTP status code logic to be used?
while developing some REST APIs I came into a logic question for which I don't have a clear answer.
Let's say I'm developing an API that a user can use to retrieve some data from a backend (e.g. ...
1
vote
1
answer
710
views
What is the correct response code for a redirection following creation of a resource?
I'm trying to follow a very pedantic thought to the end. Consider a classic use case:
POST /widgets - create a widget.
The request succeeds, and a widget with ID 1000 is created.
The user is ...
1
vote
1
answer
51
views
How to capture the http status codes using instrumentation?
All webservers including Apache, Nginx, IIS, etc log each request's http status code. I'm trying to understand how to get the Http status code from instrumentation, not from the logs. Is there a way?
-1
votes
2
answers
1k
views
How do I return the HTTP status code when I'm making a JSON post in C#?
I don't understand the variable types and how i can utilize client to retrieve the http Status code.
The client variable is a standard HttpClient object.
The attached picture is the function I'm ...
1
vote
1
answer
414
views
Does HTTP status code can have decimal values?
In .net core webapi, is there option to introduce HTTP status code with decimals example 401.2, 401.3 etc., like how it is been done in IIS?
Is it better practice to have HTTP status code with ...
0
votes
1
answer
543
views
HTTP status code for GET requests when entity is corrupted
How should servers respond to GET requests for corrupted entities?
Let's say I have a Person schema
Person {
firstName: optional string
lastName: required string
}
And due to an issue in the ...
0
votes
1
answer
5k
views
How to check http status code in vuejs and return value
I need to check the status code in vuejs, whether is it 200 or else. Here is my code, but i have errors.
methods:{
userSearch(){
let searchUrl = dataUrl+this.usersearch;
...
2
votes
3
answers
2k
views
HTTP GET Request Params - which error code? 400 vs 404 vs 422
I've read a lot of questions about 400 vs 422, but they are almost for HTTP POST requests for example this one: 400 vs 422 response to POST of data.
I am still not sure what should I use for GET when ...
0
votes
2
answers
3k
views
Why does app.put always return status code 200 when res.status(400)
I have this piece of code:
app.put("/:id", async (req, res) => {
let id = req.params.id;
// validate id
if(id < 0 || isNaN(id)) {res.send(Helper.ID_ERROR).status(400); ...
3
votes
1
answer
791
views
urequests only working on specific websites
I am using a nodemcu esp8266 and the plan is to make a spotify api request to automate playing some songs, and I have a fully functional python script that does exactly that, but when I tried to ...
1
vote
1
answer
1k
views
How can I conditionally display an error page in nginx?
How can I configure nginx to return an error_page if the URI does not contain ajax but if it does contain ajax don't send an error page and just return the response? Something like the following but I ...
0
votes
0
answers
1k
views
In c# .net how to handle if third party Rest API returns 500/400 status code with data/response
When I calling Third party Rest API in some scenario they are sending response with HTTP status code 500/404. How I can handle like this scenario.
Should I catch web exception and then check the ...
0
votes
4
answers
2k
views
What HTTP Status Code should I user when I detect an SQL injection attempt? [closed]
If I detect an SQL injection attempt in PHP (and prevent it from executing), what HTTP status code should I return?
403 Forbidden makes sense as the request was attempting a prohibited action. However,...
-1
votes
1
answer
185
views
How to Print HTTP StatusCode in Go with Visual Studio Code for a Flutter Backend?
I'm following a tutorial on integrating a Go backend with Flutter from this YouTube video. Despite following the instructions closely, I'm unable to retrieve data from the backend into my Flutter ...
0
votes
3
answers
449
views
Rest API: HTTP Status code for Informational Message
If end user not send query parameter then i want to return a message like:
return Response.status(500).entity("If you wish to download whole offerings data send query Param '...
1
vote
2
answers
78
views
Which is the best status code or api design when an external client pushes duplicate data?
We have an integration with an external client that pushes data into our system through a REST API.
For validation issues related to the payload (data transfer objects), we return 422 Unprocessable ...
0
votes
1
answer
214
views
how to handle statuscode in android studio?
I am using volley liabrary for the login. After entered wrong password progressDialog is keep running until I kill the app. And one toast message is displaying(System Generated) that unauthorized user ...
0
votes
1
answer
1k
views
Response status code for bulk-creating objects
I'm creating an endpoint that looks something like
POST '../v1/container/{container-id}/items/bulk-create'
This endpoint should get a list of items data and create them under that container.
It's ...
-1
votes
1
answer
5k
views
Flutter status code 200 when I use http.post
I'm creating an app on Flutter and when I use http.post the status code that flutter returns is 200... everytime.
When there's an actual error, from user input it returns 200, but when the data is ...
0
votes
0
answers
220
views
Code on WHM Server Keeps on Sending 'HTTP/1.1 200 OK' on every response
I'm returning different responses (and HTTP status codes) using header function for different outcomes in my code. The code seems to work perfectly fine in localhost and sends HTTP codes accordingly ...
1
vote
0
answers
55
views
How can I get data from a website when everything is loaded?
I've created a quiz that creates a link when you press buttons. This link leads to a shop and the number of products available depends on the link. I need to be able to see in my quiz how many ...
2
votes
0
answers
801
views
Does 202 status code indicate that the server cannot handle the increased traffic?
I have read from these sources:
https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html
https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/202
I am maintaining an API for internal use in our ...
1
vote
1
answer
537
views
.Net Web API return statuscode with specific type without actionresult?
I'm creating a web API and I'm using specific return types, as I have done it many times. Usually, the return status code does not matter that much as long as it conforms to REST conventions, which ...
18
votes
4
answers
10k
views
When to use HTTP status code 425 "Too Early"
The 425 "Too Early" status code's description:
Indicates that the server is unwilling to risk processing a request that might be replayed
How is it used in a real world scenario? Examples ...
3
votes
2
answers
5k
views
Asp.net Core 3.1 Web Api return custom error message from IActionResult
Is it possible to return custom error messages to client from Asp.Net Core 3.1 Web Api? I've tried a few different things to set the "ReasonPhrase" with no luck. I have tried using ...
1
vote
4
answers
4k
views
Is ending responses in Express with a status code always necessary or recommended?
I'm confused about this. I have seen a lot of people ending responses with just res.send();. At the same time, some tend to include a status code, like res.status(422).send();. I understand that this ...
0
votes
1
answer
2k
views
Unit.Value from MediatR is returning status code 200 instead of 204
consider following code
public async Task<Unit> Handle(UpdateVendorCommand request, CancellationToken cancellationToken)
{
var vendor = await _context.Vendor.FindAsync(request.Id);
...
1
vote
1
answer
57
views
Informing caller additional setup required before continuing
Need help to understand standard flow for handling additional-information-required scenario.
Context: We have a number of product implementations, all integrated with a central single sign-on server. ...
-1
votes
1
answer
2k
views
How can I check the success of my http request?
I have a get request that returns a picture of a player, but if there is no picture for actual player I get an error code of 403 and nothing is displayed.
How to solve this?
This is the service:
...
0
votes
1
answer
2k
views
HttpStatus 207 response body suggestions
I was wondering how the response body should look like when the HttpStatus is 207 Multi-status. I failed to find any examples online.
I was thinking something like a list that contains the failed ...
2
votes
1
answer
6k
views
ASP.NET Core Web API - Return a string message with a NoContent Response?
I have some records in the database that may or may not have some information for a certain column, and that's OK.
If a consumer of the endpoint runs into one of these records, I'd like to return &...
0
votes
1
answer
260
views
When would I see a nested "error" in this Angular error interceptor file?
I'm following a couple of Udemy tutorials online link1 link2 that create an Angular error interceptor file on the client side.
I'm trying to understand how and when I would see a statement inside this ...
0
votes
1
answer
692
views
What to return when failing to update a resource via API request? The resource or an error?
Suppose I'm trying to update a user via an API request to change his status to "active":
PUT http://example.com/user/12/activate
What should my request handler return if the user is already ...