Leaderboard


Popular Content

Showing content with the highest reputation on 11/29/2017 in all areas

  1. 1 point
    Alguém conseguiu fazer o upload de anexo na API de mensagens em Java? Na documentação somente mostra como faz usando 'curl' não consigo subir via API Rest. Sempre recebo a mensagem: {"message":"File attachment must not be empty","error":"bad_request","status":400,"cause":[]} Usando o Postman consegui tranquilamente conforme a imagem.
  2. 1 point
    Se me habia pasado eso. Ahi funciona! Gracias! te debo un Fernet! :)
  3. 1 point
    sergiolimo

    Adjuntar archivo

    Mmm ahi lo reformé pero me sigue dando el error 400 "message":"File attachment must not be empty","error":"bad_request","status":400,"cause":[] $url = "https://api.mercadolibre.com/messages/attachments?access_token=".$_SESSION['access_token']; $cfile = new CURLFile(realpath('c:/prueba.pdf')); $ch = curl_init(); curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: multipart/form-data')); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1); curl_setopt($ch, CURLOPT_FORBID_REUSE, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 100); curl_setopt($ch, CURLOPT_POSTFIELDS, array("file" => $cFile)); $art = curl_exec($ch); print_r($art);
This leaderboard is set to Sao Paulo/GMT-03:00