How can I download a single raw file from a private github repo using the command line?

The previous answers don’t work (or don’t work anymore). You can use the V3 API to get a raw file like this (you’ll need an OAuth token): curl -H ‘Authorization: token INSERTACCESSTOKENHERE’ \ -H ‘Accept: application/vnd.github.v3.raw’ \ -O \ -L https://api.github.com/repos/owner/repo/contents/path All of this has to go on one line. The -O option saves the … Read more

How do you properly install libcurl for use in visual studio 2017?

Here’s how I’ve got curl to work with Visual Studio 2017 15.9.14: Download curl zip package from https://curl.haxx.se/download.html (latest verified is: https://curl.haxx.se/download/curl-7.70.0.zip) Extract downloaded package to a folder of your choice (e.g. C:\curl\) Open Developer Command Prompt for VS 2017 (see Windows Start menu or %PROGRAMDATA%\Microsoft\Windows\Start Menu\Programs\Visual Studio 2017\Visual Studio Tools\) and cd to C:\curl\winbuild\ … Read more

How to download a Google Drive url via curl or wget

How about this method? When the file is such large size, Google returns a code for downloading the file. You can download the file using the code. When such large file is downloaded using curl, you can see the code as follows. <a id=”uc-download-link” class=”goog-inline-block jfk-button jfk-button-action” href=”/uc?export=download&amp;confirm=ABCD&amp;id=### file ID ###”>download</a> The query with confirm=ABCD … Read more

How do I measure request and response times at once using cURL?

From this brilliant blog post… https://blog.josephscott.org/2011/10/14/timing-details-with-curl/ cURL supports formatted output for the details of the request (see the cURL manpage for details, under -w, –write-out <format>). For our purposes we’ll focus just on the timing details that are provided. Times below are in seconds. Create a new file, curl-format.txt, and paste in: time_namelookup: %{time_namelookup}s\n time_connect: … Read more

How do I deal with certificates using cURL while trying to access an HTTPS url?

I also had the newest version of ca-certificates installed but was still getting the error: curl: (77) error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none The issue was that curl expected the certificate to be at the path /etc/pki/tls/certs/ca-bundle.crt but could not find it because it was at the path /etc/ssl/certs/ca-certificates.crt. Copying my certificate … Read more

How can I post data using cURL in asp classic?

You can do this using the WinHttpRequest object <% Dim http: Set http = Server.CreateObject(“WinHttp.WinHttpRequest.5.1”) Dim url: url = “https://www.instamojo.com/api/1.1/payment-requests/” Dim data: data = “allow_repeated_payments=False&amount=2500&buyer_name=John+Doe&purpose=FIFA+16&redirect_url=http%3A%2F%2Fwww.example.com%2Fredirect%2F&phone=9999999999&send_email=True&webhook=http%3A%2F%2Fwww.example.com%2Fwebhook%2F&send_sms=True&email=foo%40example.com” With http Call .Open(“POST”, url, False) Call .SetRequestHeader(“Content-Type”, “application/x-www-form-urlencoded”) Call .SetRequestHeader(“X-Api-Key”, “yourvalue”) Call .SetRequestHeader(“X-Auth-Token”, “yourvalue”) Call .Send(data) End With If Left(http.Status, 1) = 2 Then ‘Request succeeded with a HTTP … Read more

How can you debug a CORS request with cURL?

Here’s how you can debug CORS requests using curl. Sending a regular CORS request using cUrl: curl -H “Origin: http://example.com” –verbose \ https://www.googleapis.com/discovery/v1/apis?fields= The -H “Origin: http://example.com” flag is the third party domain making the request. Substitute in whatever your domain is. The –verbose flag prints out the entire response so you can see the … Read more