Questions tagged [curl]

2

votes
1

answer
60

Views

How can I export a Wikipedia article with slash in name via special:export using curl/wget on Windows

i tried to download a list of files via special:export. This works fine, as long as there no slash or exotic chars in the name. Österreichischer_Fußball-Cup_2013/14 --> Slash after 2013 tried to replace slash with %2F did not work İlhan_ Cihaner --> not in Latin @echo off setlocal enabledelayede...
ozz
4

votes
2

answer
2.7k

Views

Soundcloud: The requested URL responded with HTTP code 0

I moved my code base from one server to another - no code change, the only difference being https. I modified my app in Soundcloud developers to be https://url , however I continuously receive this error: [20-Sep-2013 15:08:35 Europe/London] PHP Fatal error: Uncaught exception 'Services_Soundcloud...
rickyduck
8

votes
3

answer
704

Views

Redirect Users Based on Server Traffic with PHP

I am making a website and I want to spread my traffic out to avoid crashing and to make sure I can offer 100% uptime. I will do this by having 5 different servers and one main server. Allow me to explain. I have one website (domain.com) and on the homepage of that site there is a cURL frame that con...
Cosmo Posmo
2

votes
1

answer
120

Views

How to login via cUrl?

I'm trying to use cUrl to get the contains of of a web page; but I failed because my request is automatically redirected to a sign-in page; Using the -u parameter doesn't resolve my problem. Next the HTML listing of the sign-in page: E-mail * Password * How can I provide my credentials so I can get...
Otto Barrows
1

votes
1

answer
295

Views

HTTP request with web auth and port

I need to perform a request to the following URL: http://[USERNAME]:[PASSWORD]@[SERVER_IP]:[PORT]/some/path/to/some/file BUT the finally generated URL is treated as INVALID because it contains the ':' character twice. Is there any solution? That is what I tried: $process = curl_init('http://[SERVER_...
Bogdan Burim
3

votes
1

answer
136

Views

Is there a simple way to run an authenticated Google Analytics query using curl?

I’d like to run a Google Analytics API query using curl, on the command line, and I am puzzled by the available authentication methods. I hoped I would simply get a client ID and a secret to pass along with the curl request, but all the OAuth authentication stuff looks like it insists on a round-...
zoul
4

votes
1

answer
1.2k

Views

curl - request with json object and file to Rails API

I need post file and JSON object to API (Ruby On Rails) by curl in one request. My request looks like this: curl --data @file.pdf -H 'Accept: application/json' -H 'Content-Type: multipart/form-data' -X POST -d '{'document':{'name':'file name'}}' http://localhost:3000/api/documents But Rails parse i...
user1657173
1

votes
2

answer
2.2k

Views

How to make a JSON Curl request to an api url, getting null

This should be simple I think but I just can't fathom it. I need to make a request to a url in the following format: http://ratings.api.co.uk/business/{lang}/{fhrsid}/{format} where lang will be set to en-GB the fhrsid is an identifier and format is json. I tried the following but I am just getting...
Textus
2

votes
2

answer
42

Views

Moving Aggregations ElasticSearch

G'day all i've been trying to crack away at getting a moving aggregation up and running for my application. Below is an example of what my document looks like for the metrics. '_index' : 'metrics-2017-06-23', '_type' : 'metric', '_id' : 'AVzUTWSCHd9DG10LCpmo', '_score' : 0.0, '_source' : { 'organisa...
Trent Hilliam
5

votes
1

answer
4.8k

Views

Extract paragraphs from Wikipedia API using PHP cURL

Here's what I'm trying to do using the Wikipedia (MediaWiki) API - http://en.wikipedia.org/w/api.php Do a GET on http://en.wikipedia.org/w/api.php?format=xml&action=opensearch&search=[keyword] to retrieve a list of suggested pages for the keyword Loop through each suggested page using a GET on http:...
Kane
2

votes
1

answer
45

Views

Increase curl timeout for busy servers

I've increased the timeout but it doesn't work. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://localhost.com/test.php'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_TIMEOUT, 999); $response = curl_exec($ch); print_r($response);
Adam Wright
3

votes
2

answer
158

Views

Best non-interactive approach to enter a string into a formular field and get the resulting text

In some website for which I have access, there are some input fields. In the sixth field I need to enter some input string from a list of 10000 strings, then a new page appears, for which I would just need to count the number of lines. Finally I would like to get a table with two columns like input...
flow
4

votes
4

answer
1.5k

Views
4

votes
3

answer
250

Views

What is the fastest way to 302 a link to it's final URL?

given the link http://bit.ly/2994js What is the most efficient way or library to use that would get you to the final URL of a bit.ly,fb.me, etc... after the 302 redirects? Assume the scale to be 10+ million of these a day with the ability to scale across servers. Java HttpClient? PHP with cURL? oth...
James
1

votes
3

answer
1.4k

Views

PHP: Guzzle 6 - cURL error 7 Connection Refused

I've searched and searched, and read the documentation at http://docs.guzzlephp.org/en/stable/request-options.html and confirmed the error at https://curl.haxx.se/libcurl/c/libcurl-errors.html and for the life of me, I cannot figure out what's going on. I have the URLs for both app-one and app-two i...
TomJ
0

votes
1

answer
2.5k

Views

$_POST is empty in php

I have gone through all the responses in this post print_r($_POST); ===> returns empty array print_r($_SERVER); Array ( [HTTP_HOST] => localhost [HTTP_ACCEPT] => */* **[HTTP__CONTENT_TYPE]** => application/json; charset=UTF-8' [CONTENT_LENGTH] => 942 **[CONTENT_TYPE]** => application/x-www-form-...
vivek.m
0

votes
1

answer
35

Views

JSON object returned to bash need to extract key value [duplicate]

This question already has an answer here: Parsing JSON with Unix tools 35 answers I have a curl command that gets a JSON response and it gives the response below. I need to get the value of data.value How can I do this without a 'hacky' solution? { 'request_id':'50aaabe7-d01b-0a83-da86-8f01cb1da74b...
Josh Kirby
0

votes
1

answer
556

Views

How to make CMAKE find specific version of lib curl on OSX?

Question is: How do I get CMAKE to set/make the CURL_INCLUDE_DIR be '/usr/local/Cellar/curl/7.75.0/include/'? No matter what I do, CMAKE only finds the Xcode lib version/location. My CMAKE file contains: set(CURL_ROOT_DIR /usr/local/Cellar/curl/7.75.0/include/) find_package(curl REQUIRED) message(...
Xandrix
3

votes
2

answer
107

Views

What are those threads the debugger reports SDL is spawning at initialization?

I noticed that on a single threaded application, SDL still spawns some threads on initialization. It's usually not of my concern by I noticed cURL requires its initialization to be done before any thread creation for thread-safety. Can they generally be ignored [for cURL initialization] or not? [Als...
j riv
1

votes
1

answer
212

Views

How to make a cURL request that produces the same response headers as Firefox

When I browse to a page with Firefox and click a download link, the following headers are shown when I inspect the request in network inspector: Connection: keep-alive Content-Disposition: attachment; filename='example_file.mp3' Content-Length: 35181829 Content-Transfer-Encoding: binary Content-Type...
Keyslinger
0

votes
2

answer
571

Views

How to clone all repos (including private repos) from GitHub?

I'm trying to clone all of my repos at once to my computer, all of which are private. I've tried countless one-liners and scripts (namely, the ones here and here), but none of them work. Initially I would get errors back about JSON not being able to parse the response, which I eventually realized wa...
0

votes
1

answer
306

Views

getting curl: (52) Empty reply from server when run from jenkins job (only an issue with the job that i used docker run )

I have seemed to run into some issues with curl, I have created a freestyle Jenkins job to build and deploy a basic hello world docker image. The build and deployment work fine, but I ran a curl command to test the deployment and it always fails the job below is the script that I ran npm install d...
rahul
0

votes
1

answer
919

Views

How do I create custom headers and send json data using php curl?

Using php curl I am trying to connect to an api I have built. I am having trouble creating a custom header with curl well trying to dictate some header information such as Content-Type, Content-Length. I am also struggling to understand how to properly send (post) a http-body full of json data. Esse...
floor
0

votes
2

answer
108

Views

error while compiling curl library

I have this error message while building the curl library: libssl.a(s2_clnt.o): relocation R_X86_64_32 against `.rodata' can not be used when making a shared object; recompile with -fPIC I tried to use the -fPIC switch - nothing helps. The openssl library was before compiled without any error. make...
Al Bundy
2

votes
3

answer
1.2k

Views

PHP library or command line?

I have run into two situations lately where I have chosen to use the command line for doing something rather than the PHP library. For example, in PHP doing this: `curl http://someplace.com` instead of this: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.example.com/'); curl_setopt($c...
chadgh
11

votes
4

answer
83.4k

Views

Bash - Curl (6) couldn't resolve host issue

I am having a problem with my bash script. It is producing an error of curl (6) couldn't resolve host What have I done wrong? The following is my bash script. #!/bin/bash string='$(mysql -u root -p Company 'select name from HR')' url='http://www.company.com/company/hr/$string' curl -F $url
Hend
11

votes
3

answer
16.9k

Views

How to test for “If-Modified-Since” HTTP Header support

Using PHP how can I accurately test that a remote website supports the 'If-Modified-Since' HTTP header. From what I have read, if the remote file you GET has been modified since the date specified in the header request - it should return a 200 OK status. If it hasn't been modified, it should return...
J.C
2

votes
1

answer
296

Views

cURL PHP API call not working

Trying to make a cURL PHP API call to WEocr, but I can't receive a response by the API. Here's the code I am using: $url = 'http://jimbocho.ocrgrid.org/cgi-bin/weocr/submit_ocrad.cgi'; $header = array('Content-Type: multipart/form-data'); $fields = array('userfile' => '@' . $_FILES['file']['tmp_nam...
joanet
0

votes
1

answer
681

Views

curl, node: posting JSON data to node server

I'm trying to test a small node server I've written with CURL and for some reason this fails. My script looks like this: http.createServer(function (req, res) { 'use strict'; res.writeHead(200, { 'Content-Type': 'text/plain' }); var queryObject = url.parse(req.url, true).query; if (queryObject) {...
easythrees
0

votes
1

answer
330

Views

SAS: removing junk data from XML

I'm trying to use CURL and SAS 9.3 to download XML data. I have code that correctly specifies the URL for CURL (thanks again RP) and returns an XML file. Unfortunately, there are a bunch of junk characters which precede the XML data and are causing an error. Normally, I would create a string to p...
user3806824
0

votes
3

answer
958

Views

Not getting any error message or content from cURL

Using the code below I'm not getting any kind of error or content. I'm interested in getting content of my website http://www.aptamitra.in. $cookie = tempnam ('/tmp', 'CURLCOOKIE'); $ch = curl_init(); //$timeout = 5; curl_setopt( $ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 5.1; rv:1...
EaB
0

votes
3

answer
1.2k

Views

Detecting an expired asp.net session from php

Firstly, please don't dismiss this question - I'm aware it's an ugly situation but hey, real life isn't pretty. I'm developing an extra section to a web app that's written in asp.net, but in php - it's mostly done (the two parts don't really communicate with each other outside of a database - the in...
John Hunt
-1

votes
4

answer
2.7k

Views

curl_init() isn't functioning

Anyone faced the same thing before? I've tried the same script on a XAMPP, it worked. And I'm trying to do on a WAMP, it reported call to undefined function curl_init(). I've enabled and double-checked on my WAMP php.ini on line: extension=php_curl.dll The commenting was removed alright. Could the...
woel
-3

votes
1

answer
419

Views

How to replicate command string to URL on cgywin/curl? [closed]

Currently I am using the following url string to obtain weather data from openweathermap.org. Example: http://api.openweathermap.org/data/2.5/weather?q=New%20York&appid={apikey} In response I receive {'coord':{'lon':-74.01,'lat':40.71},'weather':[{'id':803,'main':'Clouds','description':'broken clo...
Mahendra Gunawardena
2

votes
1

answer
684

Views

Facebook request from Https to Http through cUrl

On October 1st, a secure Url will be mandatory on facebook apps. Now, what I want to do is create a registration form in an iframe (php) on facebook, which does a cUrl post to an external .aspx page, which handles the parameters and inserts in the database. At this point, this works. Now my question...
samn
2

votes
2

answer
41

Views

Remote function calling with paramerters

I am using this function for calling method from one server to another in PHP. function get_url($request_url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $request_url); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = curl_exec($ch); curl_...
Shaheera
2

votes
8

answer
2.9k

Views

C++ 'GET' request or how do you download files to work with in C++?

Alright I've spent a good three days trying this, here's the scenario: I want to download a '.csv' file from Google and then do stuff with the data from the file. It's for a Win32 Console Application. I have the latter down, I just cannot for the life of me figure out how to download the file. I've...
wentz__
4

votes
2

answer
2.1k

Views

php Extract Best guess for this image result from google image search?

I have a requirement where i have to reverse lookup an image on google and extract the name printed on the 'Best guess for this image:' title. No i did some modifications to an existing curl code on the net and came this far: but it gives me lots of text and i am not able to get the exact div for it...
Suyash
2

votes
1

answer
589

Views

Does anyone know of a sample script for the Barclaycard ePDQ MPI using PHP & CURL

I'm creating a site using PHP and it has to access the Barclaycard ePDQ MPI payment interface. I've done this before using the old HSBC XML API but the Barclaycard on sees to be giving me a few headaches. The HSBC API had some pretty bad documentation and few examples so I ended up having to post an...
Mike Sav
2

votes
1

answer
262

Views

How to test a web service where there is time lag?

I am supposed to test a web service which will create an account on the server side. However, due to the architecture reason, the SOAP call will not return a message for now. So I have to issue another cURL command to test if account has been created successfully. The problem is: the account creati...
Chen Xie