curl

Curl / php Empty response from PayPal IPN url

人盡茶涼 提交于 2020-05-15 21:46:09
问题 In the past couple of days, our PayPal IPN has stopped working and receiving a empty response from PayPal. Nothing has changed on the server or in our code. Attempting to cUrl to the PayPal IPN url simply returns an empty response. $url = "https://www.paypal.com/cgi-bin/webscr?cmd=_notify-validate"; $ch = curl_init($url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FRESH_CONNECT, true); curl_setopt($ch, CURLOPT_FOLLOWLOCATION,

Trying to pull stock quote info from TDAmeritrade with Google Script with API needing authentication

。_饼干妹妹 提交于 2020-05-15 05:45:26
问题 I'm using an API from TD Ameritrade to pull stock ticker information. The script needs authentication to pull real time data. The CURL command is as follows: curl -X GET --header "Authorization: " --header "Authorization: Bearer " "https://api.tdameritrade.com/v1/marketdata/AAPL/quotes?apikey=" I'm using a Google Script to read the data from the API, do some calculations, and then write the data to a Google Sheet. Below is the script to authenticate, and it doesn't work. Note that my access

Mimic curl in python

前提是你 提交于 2020-05-15 04:52:36
问题 The following curl code works: curl --form addressFile=@t.csv --form benchmark=Public_AR_Census2010 http://geocoding.geo.census.gov/geocoder/locations/addressbatch t.csv is simply 1, 800 Wilshire Blvd, Los Angeles, CA, 90017 How do I mimic this in python. So far all of my attempts have resulted in 'Bad Requests'. I am also trying to keep everything in memory--no writing to file. One attempt: import requests url = "http://geocoding.geo.census.gov/geocoder/json/addressbatch" # data is csv like

How to set headers in ajax call with jquery

孤者浪人 提交于 2020-05-14 17:31:30
问题 I need to call an Office 365 Rest API from my own application. When I copy and paste the url on the same browser session, I can see some XML. If I paste that URL into an incognito window I get this error: The custom error module does not recognize this error. I am trying to make an API call to get that response from my application, when checking with developer tools, how they call the service I can see this: As you can see the API call has some request headers. Google chrome has the

How to pass “Content-Length” value in header using Curl Command

旧街凉风 提交于 2020-05-14 14:37:10
问题 How can I pass content-length eg. --header Content-Length:1000 in curl command. I used it like this in command but it did't work curl -v -X POST -u "xxx@gmail.com:xxx123" \ --header "Content-Length: 1000" \ --header "Content-Type: multipart/mixed" \ --header "X-REQUEST-ID:7fc7d038-4306-4fc5-89c3-7ac8a12a30d0" \ -F "request={\"bumId\":\"d51f2978-5ce8-4c71-8503-b0ca438741dd\",\"fileType\":\"imageFile\"};type=application/json" \ -F "file=@D:/file.pdf" \ "http://localhost:9090/pro/v1/files" This

How to echo the cURL result in PHP?

只愿长相守 提交于 2020-05-13 23:16:12
问题 Here is a URL→ https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=snoopy&rsz=1 and this is my php code <?php $url = "https://ajax.googleapis.com/ajax/services/search/images?"."v=1.0&q=snoopy"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $body = curl_exec($ch); curl_close($ch); $json = json_decode($body); ?> I wanna echo all of the image urls from its result (For example: http://img2.wikia.nocookie.net/__cb20110331075248

How to echo the cURL result in PHP?

佐手、 提交于 2020-05-13 23:15:19
问题 Here is a URL→ https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=snoopy&rsz=1 and this is my php code <?php $url = "https://ajax.googleapis.com/ajax/services/search/images?"."v=1.0&q=snoopy"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $body = curl_exec($ch); curl_close($ch); $json = json_decode($body); ?> I wanna echo all of the image urls from its result (For example: http://img2.wikia.nocookie.net/__cb20110331075248

How to echo the cURL result in PHP?

醉酒当歌 提交于 2020-05-13 23:12:43
问题 Here is a URL→ https://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=snoopy&rsz=1 and this is my php code <?php $url = "https://ajax.googleapis.com/ajax/services/search/images?"."v=1.0&q=snoopy"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $body = curl_exec($ch); curl_close($ch); $json = json_decode($body); ?> I wanna echo all of the image urls from its result (For example: http://img2.wikia.nocookie.net/__cb20110331075248

What does the curl option CURLOPT_HTTPPROXYTUNNEL mean?

跟風遠走 提交于 2020-05-11 05:27:08
问题 In the cURL documentation, there is an option called CURLOPT_HTTPPROXYTUNNEL which is defined to create a tunnel via the proxy when enabled. However, I have no idea what the tunnel is and what does it do. What difference will it make if I don't use a tunnel like this? curl_setopt($session, CURLOPT_HTTPPROXYTUNNEL, 1) UPDATE: What I got is that the tunnel is referring to an HTTP CONNECT METHOD and here is what I understand it does: An HTTP-based tunneling method uses the HTTP CONNECT method

Curl retry mechanism

梦想与她 提交于 2020-05-10 06:54:47
问题 I have a script I run to deploy 2 web services and a front-end application. The script calls a method that checks to see if the 2 back-end services are up and running. If so, deem the deploy successful, otherwise revert. The 2 services sometimes take longer than the front-end to start up. Currently I put in a sleep call to delay the web service check. This allows them time to start up. I want to remove this sleep and add in a retry mechanism so that if a service is down, just retry the check