How to send two objects to an api in php

0
$url = 'www.miapi.com/api/Vales';


        $ch = curl_init($url);

        curl_setopt($ch, CURLOPT_PUT, 1);

        curl_setopt($ch, CURLOPT_POSTFIELDS,item1,item2);


        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); 
        curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);
        curl_exec($ch);
        curl_close($ch);

Api

[HttpPost]
public IHttpActionResult Post(Class1 item1,Class2 item2)
{

}
    
asked by Rodolfo Mora Ibarra 10.06.2018 в 03:17
source

0 answers