• 10-12-2020, 11:29:20
    #1
    Merhaba arkadaşlar,
    Örnek bir CURL isteği var. Bunu PHP ile göndermem gerekiyor. Nasıl yapabiliriz?

    POST /uplodHTTP/1.1 
    Host: domain.com/
    Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW 
     ------WebKitFormBoundary7MA4YWxkTrZu0gW 
         Content-Disposition: form-data; name="file"; filename="image.jpg" 
         Content-Type:
     ------WebKitFormBoundary7MA4YWxkTrZu0gW--
  • 10-12-2020, 11:35:27
    #2
    Üyeliği durduruldu
    Merhaba, alttaki kodu kullanabilirsiniz:
    $ch = curl_init('http://siteadresi.com/');
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, [
    'postField1' => 'post içeriği 1',
    'postField2' => 'post içeriği 2',
    'fileName' => curl_file_create('./filepath.png')
    ]);
    $result = curl_exec($ch);