Questions tagged [php-curl]

PHP cURL extension for HTTP requests

PHP supports libcurl, a library created by Daniel Stenberg, that allows you to connect and communicate to many different types of servers with many different types of protocols. libcurl currently supports the http, https, ftp, gopher, telnet, dict, file, and ldap protocols. libcurl also supports HTTPS certificates, HTTP POST, HTTP PUT, FTP uploading (this can also be done with PHP's ftp extension), HTTP form based upload, proxies, cookies, and user+password authentication.

These functions have been added in PHP 4.0.2.

Source

1306 questions
3
votes
1 answer

Why is Linkedin Ugc Image Post Returning a 500 error?

I'm working on making an Image Share with the LinkedIn v2 api. There are three steps, according to the LinkedIn docs. Register your image to be uploaded. Upload your image to LinkedIn. Create the image share. I got past the first two using php…
James
  • 103
  • 8
3
votes
6 answers

PHP Curl is not loading in PHP 7.3.3 for windows 8.1 64 bit

I have gone through other similar questions but i cannot find a proper solution. I am a newbie to PHP. As per suggestions in youtube i have done php configuration with apache2.4 and php is working fine. I have enabled the extensions in php.ini file…
RAP
  • 137
  • 2
  • 12
3
votes
1 answer

PHP cURL - how to upload contents of a variable as a file via HTTP request?

There are lots of answers to "upload file with php curl", and they all require that a physical file exists on the machine. It's uploaded by referencing the @ symbol before the filename in the POST fields. However, I have the file data already in a…
Ryan Griggs
  • 2,457
  • 2
  • 35
  • 58
3
votes
3 answers

php curl not sending headers

I'm trying to send headers using php curl - which should be rather simple - but there seems to be an issue. Running on PHP 7.2 I'm setting the headers with curl_setopt($ch, CURLOPT_HTTPHEADER, array('My-custom-header-name' => 'Header-Value')); When…
thiout_p
  • 717
  • 11
  • 15
3
votes
3 answers

php curl headers do not return from website?

I use this command to get headers back from this specific page. curl -I https://www.gearbest.com/mobile-phones/pp_1686789.html?wid=1817324 i run the above command from terminal and i get these results... HTTP/2 200 content-type: text/html;…
stefanosn
  • 3,264
  • 10
  • 53
  • 79
3
votes
0 answers

Sending an Image to an API using Curl

I have been very frustrated in my attempt to send an image to an API using Curl. The image is coming from an html form from the clients end. When the form is submitted, I check to make sure the file is an image and the image is moved to an uploads…
Mike Sheck
  • 41
  • 2
3
votes
1 answer

How to write curl -X PUT -T script in php

I am working on a Hootsuite script that needs to upload a file using cURL PUT request. On Hootsuite site, I found below example code but I am being able to convert below code in PHP script : curl -X PUT -H 'Content-Type: video/mp4' \ -H…
Ankit
  • 627
  • 1
  • 9
  • 22
3
votes
1 answer

Download a percentage of a video with curl

I have some videos that are hosted on S3 (.mp4 and .mov) some of which are rather large (1.2GB+). I want to get the first frame from each video using the PHP wrapper for FFmpeg but I don't want to have to download the full file first. What I really…
Jimmyb_1991
  • 346
  • 5
  • 12
3
votes
0 answers

Woleet Blockchain API ERROR (with PHP CURL)

Sorry for my English, I'm not a native speaker so please don't minus me too much. I'm working on Woleet Blockchain API to protect intellectual properties (eg. Files, Docs, Images and Videos). I'm using PHP cURL library to make api requests to…
root
  • 518
  • 4
  • 20
3
votes
1 answer

curl_multi_exec: some images downloaded are missing some data / stream incomplete

I have implemented a PHP function which checks & downloads a lot of images (> 1'000) - as passed to it using an array - using the PHP curl_multi_init() method. After reworking this a few times already, because I was getting things like 0 bytes…
Oliver
  • 416
  • 5
  • 14
3
votes
1 answer

SagePay API - Incorrect request format when creating a transaction - Php

I am re posting this issue because its already asked. But nobody answer that question. i am into the problem while integrating sage pay api into my web page. i am following the documentation of sage pay. Everything is going fine and smooth but when…
Shaban
  • 334
  • 1
  • 4
  • 19
3
votes
1 answer

Apache cannot make outgoing HTTP Requests using curl

Consider the following system configurations: Fedora 27 SELinux enabled Apache/2.4.33 PHP 7.1.17 And the below code snippet that is used to issue an http request to Sphere-Engine Compilers API: $ch =…
ndrwnaguib
  • 5,623
  • 3
  • 28
  • 51
3
votes
1 answer

Failed to connect to : Connection refused - cURL PHP

So here's the scenario. 1) On my local machine that is running MAMP, I'm not facing any issue and I'm able to successfully get the response along with CURLINFO_HTTP_CODE=200 2) However, there is a remote server on which my PHP code is deployed. If I…
LEE
  • 3,335
  • 8
  • 40
  • 70
3
votes
3 answers

Discord API error #40001 Unauthorized

I auth my bot via OAuth2 URL (https://discordapp.com/api/oauth2/authorize?client_id=398437519408103444&permissions=59392&scope=bot) I want send message to channel at my discord server Code: $curl = curl_init(); curl_setopt($curl, CURLOPT_URL,…
Dmitriy
  • 159
  • 2
  • 12
3
votes
2 answers

Amazon API get all images from product

i have simple question because don´t find any answer for this. Actually i can use Amazon´s API for get informations about product from ASIN code, but in this image´s case, i can get one single image in different formats, big, middle thumb, etc,…
Jos
  • 29
  • 1
  • 5