2 json nesneleri bekliyor Resteasy servisi

0 Cevap php

I have a service that expects 2 objects... Authentication and Client. Both are mapped correctly.

I am trying to consume them as Json, but I'm having a hard time doing that. If I specify just one parameter it works fine, but how can I call this service passing 2 parameters? Always give me some exception.

İşte benim dinlenme hizmeti:

@POST
@Path("login")
@Consumes("application/json")
public void login(Authentication auth, Client c)
{
    // doing something
}

Ve burada benim PHP tüketici:

$post[] = $authentication->toJson();
$post[] = $client->toJson();

$resp = curl_post("http://localhost:8080/login", array(),
            array(CURLOPT_HTTPHEADER => array('Content-Type: application/json'),
                  CURLOPT_POSTFIELDS => $post));

Ben de CURLOPT_POSTFIELDS ne koymak için bazı varyasyonlar denedim ama işe alamadım.

0 Cevap