Hi,
PUT defaults to sending parameters as POST within the Rest API. I'll add a
way to override that behavior with a postParameters(false) method. This
will be there next week.
A potential workaround might be to use a "hack" like this:
Response<String> r = Rest.put(SERVER_URL +
"ws_carga1/ws_carga1.php?carga_id=" + Long.toString(cargaId) + "&fecha=" +
Long.toString(fecha) + "&accion=aceptar_carga")).
header("token", UsuarioService.getToken()).
getAsString();
On Saturday, June 12, 2021 at 9:39:21 AM UTC+3 [email protected] wrote:
> Hi,
> I am trying to update a record by sending parameters to a Webservice. When
> I run it it returns the code 400 (Bad Request).
> The method used is the following:
> public static Response aceptarCarga(Long cargaId, Long fecha) {
> Response<String> r = Rest.put(SERVER_URL +
> "ws_carga1/ws_carga1.php").
> header("token", UsuarioService.getToken()).
> queryParam("carga_id", Long.toString(cargaId)).
> queryParam("fecha", Long.toString(fecha)).
> queryParam("accion", "aceptar_carga").
> getAsString();
> return r;
> }
> Provide the same parameters sent through Postman and they run correctly.
> I include an image that returns the correct SQL to me via Postman
> [image: Postman.png]
>
>
--
You received this message because you are subscribed to the Google Groups
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/codenameone-discussions/d72516b4-295c-4441-b4cd-2c95ebcac6d3n%40googlegroups.com.