Skip to main content
Filter by
Sorted by
Tagged with
19 votes
1 answer
38k views

So I am learning FastAPI and I am trying to figure out how to return the status code correctly. I made an endpoint for uploading a file and I want to make a special response in case the file format is ...
Vlad Vlad's user avatar
  • 210
1 vote
1 answer
886 views

I'm trying to test how is @retry.retry decorator for my custom method works. For this I need to emulate the situation when response has HTTP statuses in ranges 2xx, 3xx, 4xx. Right now I have an ...
Evgeny's user avatar
  • 637
0 votes
2 answers
462 views

In my node Api I use the following function for a specific endpoint in order to create a PDF and return its name: exports.findOne = (req, res) => { . . . const { spawn } = require('...
user12567588's user avatar
-1 votes
1 answer
376 views

Catching 4xx and 5xx errors seems unnecessary and hard. Is it enough to only catch 4xx errors? When would even a 5xx error appear if I test my code regularly?
Derek's user avatar
  • 19
2 votes
2 answers
1k views

Lets say that a user is creating an account, but the inputs aren't valid, so I send the errors to the frontend and return a 409 status code. But when the error is in the server side, I don't want to ...
Derek's user avatar
  • 19
0 votes
2 answers
322 views

I now have a project about smart air conditioners, hoping to control the central air conditioner through the nest thermostat. I hope that when the data of the nest thermostat changes, it can be ...
hss's user avatar
  • 1
2 votes
1 answer
459 views

How to collect the HTTP response status for a script? Below is a sample code which will start a server and allow two routes for interaction. using Genie import Genie.Router: route import Genie....
Mohammad Saad's user avatar
1 vote
1 answer
64 views

I'm trying to add a function for error handling to my web app and instead of doing this all the time if err != nil { http.Error(w, "Internal Server Error", 500) return } do something ...
Polarspetroll's user avatar
0 votes
0 answers
69 views

I developed a web application with Java (Struts 2) and Web Experience Toolkit (WET - https://github.com/wet-boew/wet-boew), which is running on the WebLogic 12c server. When any one of the HTTP status ...
albertkao9's user avatar
0 votes
1 answer
937 views

I am trying to update a resource in DB via @PutMapping (org.springframework.web.bind.annotation.PutMapping) by calling a stored procedure via (java.sql.PreparedStatement.executeUpdate()). This step is ...
dexterous-unwrapped's user avatar
1 vote
1 answer
969 views

I am making a rest call using AzCli to get the backup configuration of the web apps. However there are couple of scenarios which I want to consider while making this REST call. To get the state of the ...
Bheeshma's user avatar
  • 203
0 votes
1 answer
44 views

I have anotheria/moskito already integrated into the project. It collects and plots the quantity of requests to some REST API endpoints. Anybody knows how should I tune/adjust it to collect response ...
theBeatle's user avatar
0 votes
1 answer
2k views

I need you to help me to decide what HTTP status code I should use. I have data that I want to modify with a PUT request. This data have different states possible: draft, toConfirm,confirmed,refuse ...
Couldosh's user avatar
  • 391
0 votes
2 answers
649 views

I am using a third party API and want to get the status code response from this. It doesn't use the usual http.get(request, header) format. How would we get the status code from this? This is the link ...
Suzy's user avatar
  • 261
0 votes
0 answers
2k views

I'm trying to make an username checker for Ubisoft using Python's requests. When I run my code I always get a status code 200, which should indicate that the username is available, even when the ...
user avatar
0 votes
0 answers
233 views

I used HTTP client to get the status of the URL. By Default the AllowAutoRedirect is True. It automatically process the URL redirection. But it fails if the location header returns the absolute URL. ...
user avatar
0 votes
1 answer
15 views

400 error codes confuse me and I'm not sure which this corresponds to! What status code represents : POST failed to edit because too many entries?
ByteMe's user avatar
  • 1
0 votes
1 answer
1k views

I have two classes in my views.py to handle GET all users, GET one user and POST a new user. If I try to post a user with an id that already exists, Django throws the default 400 - bad request -error. ...
lr_optim's user avatar
  • 379
0 votes
2 answers
2k views

I'm trying to make a program that checks username availability on Ubisoft.com. I tried to do this by entering a profile URL letting the code check whether the site gives a 200- or a 404 status code, ...
user avatar
0 votes
1 answer
1k views

I'm new to python and working on a python project that checks username availability on Ubisoft.com. I'm trying to do this by entering a wordlist of possible usernames and letting the code check wether ...
user avatar
0 votes
1 answer
240 views

Recently, I came across a weird contrast while developing a PHP script. The point is, I want to send an HTTP response status code to another page using the global $_SESSION variable. Then on the ...
Nicholas's user avatar
0 votes
0 answers
596 views

I was asked to calculate the availability of a web site by using a simple way: use all the non-5xx http status codes / all status codes. Is this correct? I'm new to this concept, so any response is ...
Ivan Glasenberg's user avatar
1 vote
2 answers
1k views

My app handles some HTTP requests which needs more time to complete. When request is successfully enqueued, app responds with 202 Accepted code. However there may be a case when another request is ...
Daniel Frużyński's user avatar
0 votes
1 answer
916 views

I have an API (based on dotnet core 5 if it matters) that supports multi tenancy. all requests must have a custom header (like X) that indicates the selected tenant. So based on this scenario I have ...
Seyedarman Fatemi's user avatar
2 votes
2 answers
1k views

a simple use case - unlogged user tries to reset their password. they provide wrong email or username (but the format of the data is correct). should I return 400, 412 or 404?
fanny's user avatar
  • 1,451
0 votes
2 answers
133 views

I have a google sheets script setup that checks multiple urls for their http server status. function getStatusCode(url){ var options = { 'muteHttpExceptions': true, 'followRedirects': ...
Matt's user avatar
  • 383
0 votes
1 answer
948 views

I have a rest service that receives an object like this: public class Item implements Serializable{ private static final long serialVersionUID = 1L; @Id private String ID; ...
Vlenovil's user avatar
0 votes
0 answers
2k views

I ran a graphql query with wrong input parameters, but still I got 500 response code. It should have been 400 (Bad request) as per my understanding. Can anyone please throw some light on this?
Aishwer Sharma's user avatar
0 votes
2 answers
164 views

I'm try to post request with HttpURLConnection This is request body: This is request header: This is my Code: public static String postSms(long mNo,long cepNo, String mesaj){ ...
safa aytan's user avatar
0 votes
1 answer
1k views

I'm currently consuming a REST API endpoint for bulk creation of entities via csv file upload. POST /entity/csv Content-Type: multipart/form-data With form-data: key value file binary The backend is ...
ThibaultV's user avatar
1 vote
1 answer
2k views

I have a single end point of a web service where you can queue items for processing by a bot. The items are queued, so it can take quite a while before they are actually processed. If someone make a ...
Jakob Busk Sørensen's user avatar
0 votes
0 answers
366 views

I have a problem with Jersey, I am writing a WriterInterceptor which should save the answer to the database, the problem is that I cannot retrieve the httpstatus, to avoid saving the answer in case of ...
Oldboy's user avatar
  • 43
1 vote
0 answers
609 views

When using the following Laravel helper function in a view: abort( 404 ); Instead of displaying the default Laravel 404 error page, I'm getting: Symfony\Component\HttpKernel\Exception\...
GTS Joe's user avatar
  • 4,252
0 votes
1 answer
4k views

I noticed that sometimes 596 HTTP status code is used for "Service Not Found". Why is 596 used. We already have 404 for "Not Found". I understand 404 is mostly for "Resource ...
doctemp09's user avatar
2 votes
1 answer
2k views

I have an API endpoint that checks if a password is valid based on a predefined set of password policy rules. When the password conforms to the policy, the endpoint returns 200; otherwise it should ...
Eric L.'s user avatar
  • 237
0 votes
2 answers
742 views

What HTTP status code should be sent to the user if his post request is correct but the process got stuck in decision-making(should be made by the client) situation and the client should call the same ...
Sharun's user avatar
  • 27
6 votes
2 answers
9k views

I'm working on a Web API in ASP.NET Core 5. I want to handle errors within my Web API. My service has this code. HttpException is a custom Exception I made so I can have control over the Status Code. ...
MattV's user avatar
  • 364
0 votes
1 answer
8k views

How to test my service class which has storeInDb() method and is returning database model and httpstatus.OK and httpstatus.Bad_Request along with body. public ResponseEntity storeInDb(ExeEntity model) ...
Bhavya's user avatar
  • 215
0 votes
2 answers
2k views

This is a doPost function inside a Google App that returns a Hello World message. function doPost(e){ return ContentService.createTextOutput('Hello World'); } Now suppose I want to only accept ...
Ehsan88's user avatar
  • 3,831
0 votes
1 answer
114 views

I have a rest api that meets the request for a post like the one below. POST /api/v1/products HTTP/1.1 Content-Type: application/json { "name": "product test", "...
Furkan Işıtan's user avatar
0 votes
1 answer
77 views

my problem is when i use custom axios aka axiosInstance, i only catch res.status == 200, when response is status 400, i can not take res.status and use it. My config custom axios: import axios from &...
Cyan Coder's user avatar
0 votes
1 answer
2k views

I have implemented this code, since 2 weeks now. Since then I am trying to improve my code because sometimes the Task.Delay method is not enough to wait the third party API to send the correct http ...
FritsJ's user avatar
  • 81
0 votes
1 answer
98 views

This is the code from the service i generated.Everything work fine. I get the list of photos, but i want to get the status_code and make logic in the ViewModel and show message to the user. public ...
Rajzer's user avatar
  • 1,296
0 votes
1 answer
893 views

If I have a resource with the following endpoint that lists all items within that resource: /api/v1/resources This results in: [ { "id": 1, "value": -100 }, { &...
Mikko's user avatar
  • 124
0 votes
1 answer
191 views

I'm current building a API that can return a determinated city based on it name. My code it's working, the problem that i'm facing is the correct status code to use on a request, that fulfilled itself,...
William Rizzi's user avatar
0 votes
2 answers
5k views

I know about 200 OK but what is 200 connection established? To give some background, I am testing out XMLHTTPRequest in an old firefox browser(version 26 to be exact) and I see this as the response ...
applecodervinegar's user avatar
1 vote
2 answers
2k views

If a request want to get/delete/update to a resource which isn't exist, what do you prefer to return? 204 or 404? Sample: api/blog/{id} can take that requests: GET, DELETE, PUT and api/blog can take ...
user avatar
0 votes
1 answer
136 views

Mailchimp and httpstatus.io are returning a 500 error on a URL, but the page is displaying correctly in all the browsers I've tried & the status code when fetching the page using cURL is 200. ...
JezB's user avatar
  • 528
-1 votes
1 answer
984 views

I have the following method: public IActionResult DoSomeThing() { try { Some code... } catch (Exception) { return BadRequest(); ...
Carlos Adrian's user avatar
-1 votes
1 answer
9k views

I have the following response: noResultsResponse.setMessage("No available models"); return ResponseEntity.status(404).body(noResultsResponse); This works and returns 404 with the correct ...
A.J's user avatar
  • 1,180

1
3 4
5
6 7
35