Skip to content

Tag: post

How to solve KeyError: 400 Bad Request

I have a server to which I want to send post requests in the form of json in Java. But after sending, it gives the answer: “KeyError: 400 Bad Request: The browser (or proxy) send a request that this server could not understand.”. No matter how I change the data, it still gives this error, and the sent requests do

Spring @Valid Message Not Coming Through in Response

I have a CQRS Rest API using Spring and Axon. Validation is setup for inputs using the javax.validation library. The validation is working properly, and catching that the ‘username’ needs to be at least 2 character long. However the message associated with the failed validation is not showing up in the response to the Post request. The response is ultimately

AXIOS POST Response Fetch

I have a React ui which is supposed to communicate with the backend and fetch data. Backend works well and here is its response to my request: while I receive this error in my React for the same request. The url is the same, the parameters are in place but still there is an error and I am not able

Spring POST Method Microservice 500 exception

So, im trying to write a microservice with basic GET POST PUT DELETE commands. Its a Spring Maven Java programm with a mysql server When I try to post something it works, however if I dont include the Id it returns an exception: This is weird, because in the mysql console I can Insert a customer without the id, it

Send a simple POST request from Quarkus/Java

I want to send a simple POST request to another application to trigger some action there. I have a quarkus project and want to send the request from inside my CreateEntryHandler – is this possible in a simple way? Or do I need to add something like Apache Httpclient to my project? Does it make sense in combination with quarkus?

How to send post request in java with a JSON body

I am confused as to how to send a post request in Java with JSON parameters. I have seen many examples that use HttpPost library which I can not access. Below is my code: } class main { I am trying to pass the json in the main method (I know I am not doing it right), and was wondering

JSON parse error: Cannot deserialize instance of ArrayList

I’m trying to send a JSON to a POST bodyRequest service to use this information as a Java ArrayList or something like that. When I try to do it, I receive a deserialize error This is my JSON: {information: [ {fields: “Periods Offered”, tables: “Courses”, columns: “Academic Level*”}, {fields: “Default Grading Basis*”, tables: “Courses”, columns: “Default Offering Percentage”}, {fields: “Allowed

Pass Hidden parameters using response.sendRedirect()

How would I pass hidden parameters? I want to call a page (test.jsp) but also pass 2 hidden parameters like a post. Answer TheNewIdiot’s answer successfully explains the problem and the reason why you can’t send attributes in request through a redirect. Possible solutions: Using forwarding. This will enable that request attributes could be passed to the view and you

Posting image to wcf rest service from Android

I’m having a problem to post a image to my wcf rest service. I’m posting some parameters of which one of them is a base64 utf-8 encoded string (the image). My problem is that every time I post I get “bad request”. Here is the code It is something with the encoded string, but what? Answer I don’t see why