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
Tag: post
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: public class endpointtest { …
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: {…
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
HTTP POST query how to calculate content length
I am making a HTTP POST query to a server and I am creating the post body manually. I think I am making some mistake with the content-length header because on the server side when I get the http response at the beginning I see the headers with http response 200 and then when in my php script I print
Sending Java POST request without calling getInputStream()
I would like to send a POST request in Java. At the moment, I do it like this: I do not understand why I have to call con.getInputStream() in order to actually send the request. If I do not call it, the request is not sent. Is there a problem using PrintStream? It should not matter if I take a