Questions tagged [http-status-code-422]

Unprocessable Entity

The server understands the content type of the request entity (hence a 415 Unsupported Media Type status code is inappropriate), and the syntax of the request entity is correct (thus a 400 Bad Request status code is inappropriate) but was unable to process the contained instructions.

99 questions
23
votes
1 answer

400 vs 422 for Client Error Request

I've read a lot of posts and articles regarding proper http status code to return for client request error. Others suggest to use 400 as it has been redefined in RFC 7231 though I'm not sure if the example given covers all the client error in my…
13
votes
3 answers

HTTP status while POST with incorrect data (using id of resource which does not exist)

What would be the correct HTTP status to return when I am performing the POST request to create a new user, but one of its parameters is incorrect - the company id I am including with the user data doesn't exist in the database. POST data:…
Talita
  • 805
  • 3
  • 11
  • 31
10
votes
3 answers

FastAPI post does not recognize my parameter

I am usually using Tornado, and trying to migrate to FastAPI. Let's say, I have a very basic API as follows: @app.post("/add_data") async def add_data(data): return data When I am running the following Curl request: curl…
Djoby
  • 602
  • 1
  • 6
  • 22
7
votes
1 answer

How to fetch the error message from 422 Unprocessable Entity response

I make an api call which returns me this Response{protocol=http/1.1, code=422, message=Unprocessable Entity, url=https://someapi/endpoint} In the logs, along with the response i get the following: {"message":"Validation…
6
votes
1 answer

HTTP status codes when errors in the request body

Can someone please clarify what status codes should I expect from following situations? For instance, I am sending POST request with such body format: { "id": 321, "username": "tombrown", "email": "tombrown@gmail.com", "password":…
6
votes
2 answers

What is the meaning of 'semantic errors' or 'semantically erroneous' in 422 errors?

I'm looking through an advanced, security related Ruby on Rails tutorial and it's talking about 422 HTTP responses as "the client submitted request was well formed but semantically invalid". I have also seen the latter part rendered as 'semantic…
user7630939
5
votes
2 answers

How to deserialize 422 unprocessable entity error model and bind the errors to asp.net core razor pages model state

My Asp.Net Core 3.1 API returns 422 Unprocessable Entity error response as shown below: { "type": "https://test.com/modelvalidationproblem", "title": "One or more model validation errors occurred.", "status": 422, "detail": "See the errors…
4
votes
2 answers

FastAPI: How to customise 422 exception for specific route?

How to replace 422 standard exception with custom exception only for one route in FastAPI? I don't want to replace for the application project, just for one route. I read many docs, and I don't understand how to do this. Example of route that I need…
Octoloper
  • 205
  • 2
  • 9
4
votes
1 answer

FastAPI file upload

I am trying to upload JSON data + file (binary) to FastAPI 'POST' endpoint using requests. This is the server code: @app.post("/files/") async def create_file( file: bytes = File(...), fileb: UploadFile = File(...), timestamp: str =…
4
votes
2 answers

How to Fix '422 Unprocessable Entity' when sending a POST request to Redmine API?

I am trying to create a wiki page using redmine rest api. The Authentication was succeeded, however the wiki page is not being created because of a 422 error. The Redmine documentation says: "When trying to create or update an object with invalid or…
4
votes
3 answers

Error: 422 (Unprocessable Entity). Angular4

I am trying to post data from Angular4 on localhost:4200 to an API on localhost:8000. I works fine with Postman, but not with Angular. Then I get: Failed to load resource: the server responded with a status of 422 (Unprocessable Entity) This is the…
Skvupp
  • 155
  • 2
  • 3
  • 12
3
votes
2 answers

File upload using FastAPI returns error 422

I am using the example from the official documentation: https://fastapi.tiangolo.com/tutorial/request-files/#import-file Server code: @app.post("/uploadfile") async def create_upload_file(data: UploadFile = File(...)): print("> uploaded…
stev
  • 83
  • 1
  • 8
3
votes
1 answer

Error in Angular with HTTPparams 422 (Unprocessable Entity) and FastAPI

I have this url in backend and need pass c1 like a parameter, c1 is only an example, this method enable or disable an user and give back an "ok" http://127.0.0.1:8000/admin/enable_disable_account?name=c1 the value is taken from a button
3
votes
1 answer

ActiveCampaign axios post request returns 422

This is the object and the post request let contactObject = { contact: { email: "jsmith@example.com", firstName: "John", lastName: "Smith" } }; const options = { method: 'POST', headers: { …
3
votes
0 answers

What is the allowed syntax for a Github release tag_name?

The apps I'm trying to place under version control store their version number as a timestamp... 2019-12-28T05:13:47Z . When I try to add this timestamp as a Github release tag_name using the API... { "tag_name": "2019-12-28T05:13:47Z", …
SeaDude
  • 3,725
  • 6
  • 31
  • 68
1
2 3 4 5 6 7