Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #11  
Antiguo 06-06-2024
Neeruu Neeruu is offline
Miembro
 
Registrado: oct 2007
Posts: 510
Poder: 18
Neeruu Va por buen camino
Una consulta:

Tengo un JSON, con esta estructura:

Código:
{
    "PROVEEDORES": {
        "COD_PROV": 4,
        "NOM_PROV": "PRUEBA3_EDIT",
        "COD_USER": 0
    }
}
Si esta de esa forma, cuando mapea asi:
Código Delphi [-]
    [MVCPath('/api/proveedor')]
    [MVCHTTPMethod([httpPOST])]
    procedure CreateProveedor([MVCFromBody] Proveedor: TProveedor);
No me carga los valores en el objecto Proveedor.


Ahora si saco la palabra "PROVEEDORES" de JSON mapea correcto los valores.
Hay alguna configuración para indicarle el nombre del Objecto.

Código Delphi [-]
  TProveedor = class
  private
    [JSONName('COD_PROV')]
    FCODPROV: Integer;
    [JSONName('NOM_PROV')]
    FNOMPROV: string;
    [JSONName('COD_USER')]
    FCODUSER: Integer;
  published
    property COD_PROV: Integer read FCODPROV write FCODPROV;
    property NOM_PROV: string read FNOMPROV write FNOMPROV;
    property COD_USER: Integer read FCODUSER write FCODUSER;
  end;

Disculpen si mi terminología no es correcta.
__________________
Saluda Atte Neeruu!!! :)
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
servidores rest avmm2004 Varios 3 05-08-2021 09:37:44
API REST en delphi darkbits Varios 1 21-10-2020 08:58:10
PHP / Rest DataSnap Rockin PHP 8 14-02-2017 20:49:38
Rest roman La Taberna 11 30-07-2014 16:52:00
REST, Marshaling y \ iuqrul Providers 1 08-11-2013 10:51:33


La franja horaria es GMT +2. Ahora son las 18:49:26.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi