1,708 questions
0
votes
1
answer
65
views
Scrapy handle status 202
I'm quite new to web scraping, and in particular in using Scrapy's spiders, pipelines...
I'm getting some 202 status from some spider requests' response, hence the page content is not available yet
...
-1
votes
3
answers
85
views
What is the correct HTTP status code when the authenticated user’s record is missing in the database (e.g., /user-info endpoint)? [duplicate]
I’m designing a RESTful API endpoint like this:
resource function get user-info(http:RequestContext ctx)
returns database:UserInfo|http:InternalServerError|http:NotFound {
authorization:...
0
votes
1
answer
70
views
How to correctly handle http error code in multi-module compose app?
i'm building a multi-module jetpack-compose login/signup app. My backend is handled using Spring boot and the login/signup function returns a ResponseEntity.
The task: in my frontend i want to display ...
-1
votes
2
answers
101
views
Meaning of Error and httpStatus.statusCode returned from Swift request using URLSession.shared.dataTask
I am doing a POST request using URLSession.shared.dataTask which returns data, response and error. I would think that Error would be the same as a failed request. However, I can get the request to ...
0
votes
1
answer
267
views
How to customize the "413 Payload Too Large" response in Quarkus with multipart/form-data requests?
How to customize the "413 Payload Too Large" response in Quarkus with multipart/form-data requests?
I'm working with a Java 21 Quarkus (3.18.1) API that uses the quarkus.http.limits.max-form-...
1
vote
2
answers
47
views
Laravel 9.x different status code while automated testing
One of my automated tests is returning status code 302 whereas it should return 422.
CategoryTest.php
class CategoryTest extends TestCase {
use RefreshDatabase;
...
public function ...
0
votes
0
answers
63
views
How do I get responses from Spotify API after status code 304?
I have started learning about and experimenting with the Spotify API recently. So, I wrote the following code to fetch audio features like acousticness, danceability etc. of my liked/saved songs:
def ...
0
votes
0
answers
104
views
How to translate the not-found page in Next.JS
My website has translations, and I want to translate my error pages. But I translate my pages with a dynamic route (/app/[locale]) and not-found.tsx must be at the root (app/not-found.tsx). I don't ...
1
vote
0
answers
35
views
api returns 419 xhr error in nextjs and laravel
I am using Nextjs, for frontend and laravel for backend. My Login api works fine in postman, but in frontend it return 419 xhr error. What can I do to fix this?
export const postLogin = async (data: ...
2
votes
1
answer
59
views
Filter Network requests by status code in Firefox browser console
How can I show only certain HTTP status codes in the Firefox browser console?
For example, I just want to see a list of all image requests that returned a 404 error. The console has a setting to show ...
1
vote
0
answers
23
views
How does a response code influence the execution of an API call in Groovy? [duplicate]
New to Groovy, not experienced working with APIs. So my apologies if this is something general and not related with these topics. I just wish to understand it a bit.
I try to trigger a small script ...
-1
votes
1
answer
68
views
What is the correct status code for a semi-ok response? [closed]
I have a client that is asking the server for n elements. The server is asking ChatGPT for n elements, but sometimes ChatGPT returns n-1 or n+1 elements.
Client Code
const count = 3;
var elements = ...
-1
votes
1
answer
127
views
499 when using fetch/fetch-node in NodeJS
Stack!
The strange situation I'm facing with. I have a code, that is dead-simple:
fetch('https://www.o2.pl').then((response) => console.log(response.status));
I tried this with
both fetch and ...
0
votes
1
answer
89
views
C# API Controller Returns 400, but fetch in JavaScript hows 422 Status Code - Why?
I'm testing my C# API endpoint and encountering a discrepancy between the status code I return in my controller and what I receive by using fetch. I have configured my C# controller to return a 400 ...
0
votes
0
answers
220
views
ASP.NET Core returns statuscode 0 when long polling timeouts before .NET 8. In .NET 8, it returns statuscode 499
We have an ASP.NET Core application that the client normally uses long polling to get results:
before .NET 8, when long polling times out, the client throws a timeout exception which is expected. On ...
0
votes
1
answer
88
views
Reverse proxy in ASP.NET Core: how to return the HTTP status code from destination server?
I'm using ASP.NET Core and Flurl to write a reverse proxy that sends requests to one destination server, another server, or both, depending on how the reverse proxy is configured at runtime. I want ...
1
vote
1
answer
84
views
What's the correct HTTP status for rendering HTML form after logically failed response via HTTP 303 redirect?
I'm writing a web service with REST schemantics where the user with a standards compliant web browser will be filling a form which is processed by the server. To avoid double submit if the user ...
1
vote
1
answer
498
views
.NET 8 Middleware Unexpectedly Changes Status Code to 204 After _next(context)
I am working on a .NET 8 Webapp. I have implemented a middleware to log requests and responses, but I'm facing an issue where the status code is unexpectedly changing from 200 to 204 after calling ...
1
vote
0
answers
118
views
HttpClient GetAsync every redirected URL
If you look at the answer on this page, you can see its outdated code. How to upgrade it to HttpClient and using async methods instead?
I have been trying to adapt this code for a number of hours now ...
1
vote
1
answer
67
views
Ruby on Rails - How do I access the HTTP status code in my ERB view?
Suppose I have a controller which sometimes renders the view normally, and sometimes renders the view with HTTP status code 409. How do change what is displayed in the view based on the status code?
I....
-1
votes
1
answer
58
views
What is the most appropriate HTTP status code for this message: "You must be 13 years or older to register"?
I am using the HTTP status code "403" for now but I want to know if there is a more appropriate HTTP status code.
{
"status": 403,
"message": {
"en":...
2
votes
1
answer
996
views
In the Firefox DevTools Network tab, how do I see only failed requests?
I want to be able to see all requests that have error responses (of any kind). By that, I mean requests that have a response with a status code like "4xx" or "5xx".
I discovered ...
0
votes
1
answer
50
views
HTTP Authenticated Subject Alias Redirect
Given an HTTP REST service that manages identity data, for example, where a user resource is available at /Users/{id}, I would like to define a URI alias, /Me, that allows authenticated callers to ...
0
votes
1
answer
67
views
NestJS: Error Thrown Not Propagating to Frontend, Returns 200 Status Instead
I am working on a NestJS application where I have a controller method that fetches new users from DB. During this process, an error should be thrown under certain conditions. But my frontend desktop ...
0
votes
1
answer
255
views
How do I get the status codes for responses on TWebHttpRequest in TMS WEB Core?
I'm using the TWebHttpRequest component in TMS WEB Core to do an API call, but I'm not sure how to get the status codes of the response.
This is the current code that I use to do the API call using ...
0
votes
1
answer
74
views
What is the proper error code when API parameter value(s) not match the endpoint?
Suppose the endpoints called:
/fruit
/meat
and there is a correct parameter called 'Farm', but parameter value pass to the endpoint is incorrect/out of boundary, in which that value is related to ...
0
votes
0
answers
43
views
Laravel RestClientException For 201 Response
I am using RestClient to make request to the thirdparty api.
I am using the following code
try {
$payload = [
"email" => $user->email,
"groups" => [
...
1
vote
1
answer
1k
views
Polly v8 - Retrying specific status codes using the PredicateBuilder
I am using Polly v8 and .NET framework 4.7.2 to retry on specific status responses only. However, when trying to restrict the retry to only these statuses the code will no longer invoke the retry ...
1
vote
1
answer
35
views
How repeat a proxy server with a checksite after a failed
my code doesn't repeat after a failed
import requests
with open("valid_proxies.txt", "r") as f:
proxies = f.read().split("\n")
sites_to_check = ["https://open....
10
votes
4
answers
19k
views
HttpStatusCode in Spring Boot 3
I just migrated an application to Spring Boot 3 and before the migration I used HttpStatus to obtain more details about the error message that a certain web client returned with the gerReasonPhrase() ...
0
votes
1
answer
147
views
What is causing my python script using Google APIs to throw a status code 3 & 6?
I'm attempting to download all image files from a specified Google doc, save the image files to a designated directory on my machine then upload all the image files to a designated Google photo album.
...
0
votes
1
answer
40
views
HTTP response code when trying to associate an item with another but is already associated
I'm wondering which is the best choice for the HTTP response code in the following situation:
There is a POST / PUT REST API that associates a resource (let's call it source item) with another one (...
0
votes
2
answers
579
views
How to get status_code from an exception object
In my code I have a get request as:
response = requests.get(url)
For invalid status code ie non 2xx an exception is raised,
exp_obj = RequestException(response)
Now I want to get the status code from ...
0
votes
1
answer
826
views
appropriate HTTP status code for non-existent resources in REST API?
I am engineering a REST API server application, trying to establish a rule for the server response when a resource does not exist. While we can define our internal codes within our team, there is a ...
-2
votes
1
answer
380
views
axios give me error (POST /api/v1/users/token/refresh/ HTTP/1.1" 401 65) , How solve it?
in windows 10 , i'm using react-router-dom 5.2.0 and react-redux 7.2.5 and react 17.0.2. and axios 0.21.4 and WebStorm 2023.1.3 IDE.
Consider 1 - axiosInstanse.js:
import jwt_decode from 'jwt-decode';...
1
vote
1
answer
926
views
Does HTTP have a "not ready yet" response code?
I'm designing an API and I need to document a response to a GET request for the following situation:
You (the client) have made a valid GET request.
You have the right to GET this particular resource.
...
-1
votes
1
answer
991
views
How to access http status in Azure Function v4
How do i read the http status of a http trigger function built using Azure Functions v4?
The equivalent in v3 would have been something like
const statusCode = context.res.status;
context.log(HTTP ...
3
votes
2
answers
3k
views
Why does Chrome show me a 200 Temporary Redirect status code?
We're witnessing a strange behavior when trying to load a site that is behind a waf. There's a couple of misterious redirects, but one of them caught my eye: it has a 200 Temporary Redirect Status ...
0
votes
1
answer
450
views
PHP http_response_code doesn't seem to work. I *must* be doing something wrong
Building a webhook receiver in PHP 7.4.30.
I can receive absolutely fine. No problems there :-)
However, we need to carry our synchronous validation on the JSON and send back a 400 bad request and a ...
0
votes
1
answer
894
views
When and Why Should I Use the HTTP 304 Not Modified Status Code in a Spring Application?
I'm currently working on a Spring application and I've come across the HTTP 304 Not Modified status code. While I understand its basic purpose, I'm struggling to grasp real-life scenarios where it ...
1
vote
1
answer
555
views
Return a non-200 Http Status from a .net lambda - without an API Gateway
I'm trying to return other http status codes from .net using amazon.lambda.core - I tried this as a handler:
public async Task<string> Handler(string input, ILambdaContext context)
{
...
0
votes
1
answer
302
views
What HTTP response code to use to signal to a client that a new version is available?
I manage an application that has an irregular update schedule that requires live fixes and also deals with realtime data. I want to notify clients (currently just web clients) that a new version is ...
0
votes
0
answers
286
views
Airflow does not reflect status of GCP Cloud Run job once complete
I have an Airflow DAG (GCP Composer) that invokes a Cloud Run job using HTTPS POST.
I am using a PythonOperator to invoke the Cloud Run job as follows:
run_report_task = PythonOperator(
...
0
votes
1
answer
980
views
Resource Limit Is Reached or HTTP Error 503 Service Unavailable in every site
i am currently working on a worpress site, as i was scrolling on the products page, the page got very slow, and after some times it would be stuck and take a lot of time to load other products, then ...
0
votes
2
answers
3k
views
How to get HTTP status errors from cURL 8.0?
When testing some REST API, I'm using a cURL command.
However when the request failed, it seems that cURL does not indicate that there was a non-success status code (HTTP/2 405 in my case); instead I ...
0
votes
0
answers
229
views
Spring Boot default exceptions automatically mapped to a http status code
In my spring boot rest api app,I want to define a automatic method for unhandled exception.Suppose client give wrong password in login endpoint.The response is 403 forbidden without any message.but i ...
1
vote
3
answers
2k
views
When building a REST API, must I use status codes?
I'm developing a web application that has a backend API, which is going to be primarily used by a reference frontend application, but other clients can use it too.
The data my API sends has a specific ...
0
votes
1
answer
451
views
Status Code to return for refresh token validation successfull, but user not found?
I'm building an Api with Jwt token auth, in my refresh token method i validate the token using the official JwtSecurityTokenHandler.ValidateToken() method then i go and get the user from the DB. My ...
1
vote
1
answer
3k
views
How to set a response status for a nuxt page? 404
I want to set response status 404 on my /not-found page.
I tried to:
create custom error page in ~/error.vue and throw fatal errors with createError. But it just sends 200
throw fatal errors and use ...
0
votes
1
answer
3k
views
Getting content-type from a request (httpRequestData) in Azure Function
I need to verify if the content coming into my Azure http function is not empty and is of type JSON.
So I am doing this within my Azure function:
if (req.Body.Length == 0)
{
...