In the screenshot you posted it looks like you passed the parameters in the 
URL.

On Sunday, June 13, 2021 at 5:14:04 PM UTC+3 rdvg...@gmail.com wrote:

> Hi,
> Excuse me, if it works fine when I send information through the body.
>
>
> El Sunday, June 13, 2021 a la(s) 8:31:23 AM UTC-5, rdvg...@gmail.com 
> escribió:
>
>> Hi,
>>
>> Thank you very much Mr. Shai, I have other methods in my application that 
>> they use in the PUT method and I need to send information through the body. 
>> In this scenario it also sends me error. Have another trick to move forward?
>>
>> El Saturday, June 12, 2021 a la(s) 8:38:36 PM UTC-5, Shai Almog escribió:
>>
>>> 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 rdvg...@gmail.com 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 codenameone-discussions+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/3d7043c5-1971-42f1-9800-a6131ba691c6n%40googlegroups.com.

Reply via email to