curl

guzzle concurrent request, wait for finished batch before sending next

主宰稳场 提交于 2021-02-08 10:17:41
问题 I thought this following code would work this way: a batch in the number of CONCURRENT_REQUESTS is send it is waited until all of these requests are finished the next batch of the above number is send and so on but in reality if I comment line 14 [ usleep(...) ] it seems the request batches are send as fast as possible generating thousands of queries to the server. Is it possible to change it? How do I change this behavior? <?php $pool = $this->getPool(); if (false !== $pool) { $pool->promise

400 Error. Recipient address required. curl

我的梦境 提交于 2021-02-08 10:13:02
问题 I used Gmail API with curl.( Users.messages: send) But I recieve Error 400 recipient address required. Command curl -X POST -H "Authorization: Bearer *****" -H "Content-Type:message/rfc822" -d "{'raw':'Encoded Value'}" "https://www.googleapis.com/upload/gmail/v1/users/me/messages/send" Response { "error": { "errors": [ { "domain": "global", "reason": "invalidArgument", "message": "Recipient address required" } ], "code": 400, "message": "Recipient address required" } } The encoded value was

cURL not loading style/css

吃可爱长大的小学妹 提交于 2021-02-08 10:06:51
问题 So I have this pretty simple cURL code that should be retrieving the data of a page... Well, it actually does show the page's contents... sometimes , and also, most of the other times the style is all messed up, as the fonts aren't loading and neither do most of the images and graphic elements. The results vary if I change the URLs of the page I want to show, with some loading no problem, others not showing anything at all. I guess there's a problem with how the cURL handles the css, how can

Public key pinning in curl does not work without using certificates from the system

冷暖自知 提交于 2021-02-08 09:34:07
问题 I am trying to use libcurl with public-key pinning in order to verify a server's authenticity when downloading a file. Curl is compiled so that it doesn't use any certificates on the system, but only relies on certificates it receives from the user: ./configure --without-ca-bundle --without-ca-path --without-ca-fallback && make First I obtain the sha256 sum of the server certificate's public key, as explained here: $ openssl s_client -servername www.example.com -connect www.example.com:443 <

Unable to upload a pdf document using dr chrono api via php cURL

血红的双手。 提交于 2021-02-08 08:16:18
问题 I am using php curl to upload pdf document using in dr chrono using api/documents. Actually I am not clear on how to pass my pdf file so that it gets uploaded. Here is my params array $handle = fopen('pdfsPatientInformation_1446467593.pdf', 'r'); $myfile = fgets($handle); $docParams = array('doctor' => 7891,'patient' => 58001561,'description' =>'Patient Medical History Form','date' => '2015-02-11','document' => $myfile); I am getting error {"document":["The submitted data was not a file.

how to automatically write curl output to a new file

末鹿安然 提交于 2021-02-08 07:43:22
问题 I am using cURL to retrieve stock information back to the terminal window on my Mac using the yahoo finance api. i.e. I type: curl -s 'http://download.finance.yahoo.com/d/quotes.csv?s=aapl&f=l1' and it prints the output (in this instance the last trade price in the command line) It works terrific, but I would like to know how to get this output automatically written to a stock.txt file located on my desktop without any manual intervention upon the execution of the original cURL command. Thus

axios equivalent to curl --upload-file

梦想的初衷 提交于 2021-02-08 07:36:46
问题 I'm trying to upload a gif to Gfycat using their public API. This is done using cURL on the command line with: curl https://filedrop.gfycat.com --upload-file /tmp/name I attempted to convert this to Node.js using axios: axios.post("https://filedrop.gfycat.com", { data: fs.createReadStream("/tmp/name") }).then(console.log).catch(console.log); but an error with the message <?xml version="1.0" encoding="UTF-8"?>\n<Error><Code>PreconditionFailed</Code><Message>At least one of the pre-conditions

Trying to Load A Message Payload from a JSON File in Bash to Send to Slack Channel

故事扮演 提交于 2021-02-08 07:36:42
问题 So I am trying to send a message to a specific slack channel using a secrets.json file to specify the payloads for both messages and the web-hook URL. I am able to post things to the message but it does not load the message as a payload even though the payload variable is set correctly. How can I load message payloads within the curl command I am specifying? Here is the code: richardbarret@1152-MBP  ~/Git/SalesforceCLI/Integration/Slack   master ●  ./automated_messages.sh  ✔  1488  10

python requests module doesnt work when curl works. What am I doing wrong?

荒凉一梦 提交于 2021-02-08 06:32:39
问题 I have a curl request and a similar request using python requests module to a local web service. While the curl request is working correctly, the request made via python isnt working as expected, ie doesn't return a json reponse. Any ideas as why this is happening? With python I still get a 200 response, but getting HTML response text instead of json like in curl and the response is something about invalid session etc. This is the curl request root@weve1:~$ curl -k --GET --data "ajax

Using file_get_contents or curl to url on same server

大兔子大兔子 提交于 2021-02-08 06:14:30
问题 I have a PHP script that needs to process the same site's RSS feed. Specifically, I'm displaying the most recent blogs from the WordPress RSS feed on the home page. On our staging server it worked fine but on our live (which is a completely different, but LAMP) hosting environment it's not working. I can run file_get_contents or curl on a remote url fine, but when I try to retrieve our own RSS feed, I am returned a 404 not found page. One other oddity, if I try file_get_contents(http://domain