Questions tagged [http-status]

The status code describes the state of the response from the web server.

Each Status-Code is described in the W3C HTTP 1.1 specifications, including a description of which method(s) it can follow and any metainformation required in the response.

78 questions
3
votes
1 answer

REST API Http Status code for Unconfirmed email but successful login

I have a use case here, a user registers in a website and has got an account activation link through email. User tries to login without activating his account. What would be the Http status code for the login request, both username and password is…
Valamburi M
  • 692
  • 4
  • 17
3
votes
1 answer

What's the right HTTP Status code for a blocked, abusive user?

I am building an app in which users might be blocked for using offensive language. When a user is blocked, his or her app can not access some API calls. What should be the right HTTP status code when a blocked user tried access these API parts?…
Adam Matan
  • 128,757
  • 147
  • 397
  • 562
3
votes
1 answer

Is is possible to change HTTP status in MessageBodyWriter?

How can I change HTTP status in MessageBodyWriter in Jersey? I know I can change header and the body response message via httpHeaders and entityStream in writeTo method, but I dont know how to change the HTTP…
Codler
  • 10,951
  • 6
  • 52
  • 65
2
votes
3 answers

HTTP status code for an expired confirmation code

I have an endpoint in my REST API that sends a code the user received per email to verify the email address. What status code should I better use to return that this code has expired? Is it 401, 410 or 498?
Diana
  • 935
  • 10
  • 31
2
votes
2 answers

What http status should I send for a malformed json response?

I'm building a simple http server in nodejs that validates the outgoing json. If the validation fails, what would be the correct status code / error message to send to the client?
brielov
  • 1,887
  • 20
  • 28
2
votes
1 answer

AWS API Gateway, Python Lambda and HTTP status

I'm struggling to understand how to setup proper http status codes and error messages using AWS API Gateway and a Lambda Function (python) as Integration type. I'm working with a simple example, here the details: Lambda function def…
AlessioG
  • 576
  • 5
  • 13
  • 32
2
votes
1 answer

Http status code to send if server state invalid?

I am writing a REST service and some of the push requests will only work during a certain window of time. For example during active work hours. Outside of those times the server will send an error. I have looked at the available HTTP status codes…
Andre M
  • 6,649
  • 7
  • 52
  • 93
2
votes
0 answers

How to test and fetch http authentication error in CasperJS

How can I test http authentication error and fetch the error code with CasperJS (can't use any other tool like SlimerJS) when accessing a web page with wrong credentials? My code start with: var casper = require('casper').create(); if…
FotisK
  • 1,055
  • 2
  • 13
  • 28
2
votes
2 answers

How to return HTTPMovedPermanently (301 status) instead HTTPFound (302) in pyramid notfound_view_config

Using notfound_view_config in pyramid with parameter append_slash=True, i get 302 http status when redirecting, but i want set custom http status - 301. @notfound_view_config(append_slash=True, renderer="not_found.mako") def notfound(request): …
okuznetsov
  • 278
  • 1
  • 5
  • 12
2
votes
1 answer

getting http status from this ajax call

I am really new to ajax and jquery, so please bear with me. I am currently building a small application that will do the basic task of telling you a website's status code, and doing something based on the code that is returned. I found this code…
pattyd
  • 5,927
  • 11
  • 38
  • 57
1
vote
1 answer

how to return only HTTP Status code, if we hit one pre-defined endpoint

When I hit @FeignClient(name = "abc_abc", url = "${abc.host}") public interface validateClient { @PostMapping(path = "/api/abc/validate", consumes = "application/json", produces = "application/json") **public
1
vote
0 answers

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, I am trying to use Weserv. Then, if this is not…
1
vote
0 answers

My TeaMaster9001 is responding with code 418 whenever I send a brew-coffee request

My TeaMaster9001 is running on my IoT network, and it has an IP address of 172.16.1.10. Whenever I send a GET request in Python 3.9.5, I get a requests.exceptions.HTTPError. Here is my code (brew-coffee.py): import requests response =…
Perzan
  • 15
  • 1
  • 3
1
vote
2 answers

How to force Spring Boot to set correct HTTP status code to error response?

I made this simple Spring Boot app-example to showcase my problem with the way Spring Boot handles error by default: package com.pany.app; import org.springframework.boot.SpringApplication; import…
maxxyme
  • 2,164
  • 5
  • 31
  • 48
1
vote
0 answers

How do I force Nancy to use application/json Response for Integers? Nancy assumes them to be StatusCode

I found this thread Override the default Content-Type for responses in NancyFx and would've commented there, but haven't met the 50 rep reqirement yet as this is my first account after years of lurking here. So please bear with me if this problem…
OllyWood
  • 11
  • 1