Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Jun 15 11:16
  • Jun 15 11:07
    CLAassistant commented #159
  • Jun 15 11:07
    siwymilek opened #159
  • Jun 02 23:28
    Travis Kong/unirest-php (master) errored (255)
  • Jun 02 23:16
    Travis Kong/unirest-php (master) errored (254)
  • Jun 02 22:27

    curiositycasualty on master

    (compare)

  • Jun 02 22:24

    curiositycasualty on master

    (compare)

  • Jan 17 17:06
  • Jan 17 17:04
    Travis ennorehling/unirest-php (master) errored (1)
  • Jan 17 17:01
    CLAassistant commented #158
  • Jan 17 17:01
    ennorehling opened #158
  • Jan 17 16:39
    ennorehling commented #156
  • Jan 17 16:37
    ennorehling commented #156
  • Jan 17 16:37
    ennorehling commented #156
  • Jan 17 16:33
    ennorehling commented #156
  • Jan 07 11:59
    JamieSlome opened #157
  • Dec 22 2021 09:04
    EdgarWahn edited #156
  • Dec 22 2021 09:03
    EdgarWahn edited #156
  • Dec 22 2021 09:02
    EdgarWahn opened #156
  • Sep 15 2021 14:48

    hutchic on travis_exfiltrate

    travis exfiltrate (compare)

orliesaurus
@orliesaurus
problem half solved!
orliesaurus
@orliesaurus
good luck flo :)
Jay
@jaypatel512
One Question. What happens if I want to override some curl headers ? Is it doable ?
Nijiko Yonskai
@nijikokun
@ahmadnassri ^
Ahmad Nassri
@ahmadnassri
@jaypatel512 if you mean HTTP headers sent by cURL, then that's up to the C-level lib-curl internals, for example: Content-Length, Content-Type may automatically be set by curl, some can be overridden, some cannot not (since they happen AFTER you call to execute the request) its really up to the version of php/curl you're running ...
Ahmad Nassri
@ahmadnassri
v2.6.0 is out with ability to set custom cURL options
Joseph Ting
@josephting
@ahmadnassri Awesome! Just tested it out and it's working great. Thank you so much.
Ahmad Nassri
@ahmadnassri
:+1:
Ahmad Nassri
@ahmadnassri
yay travis notifications now working in gitter!
Oliver Kurowski
@a4mc
Hello Team.. i've got a problem.. : i get a warning "PHP Warning: array_map() expects parameter 1 to be a valid callback, function 'hex2bin' not found or invalid function name in /var/www/vhosts/a4mc-malta.org/httpdocs/dvse/export/Unirest/Request.php on line 445" but, PHP is 5.6 and locally, it worked..
any ideas ?
Oliver Kurowski
@a4mc
gut it.. cgi was 5.3 .. thanks
仇柯人
@qiukeren
well, PHP does not contain thread,
I uses the pthreads library in pecl.(which would be wildly used)
And is unirest php thread safe?
Ahmad Nassri
@ahmadnassri
@qiukeren it was never tested with pthreads ...
fermino
@fermino
It should be safe
You can have troubles if you share the environment
By passing PTHREADS_INHERIT_ALL constant to $Thread->Start();
It will allow you to use loaded classes/traits/interfaces without including again
But, if you don't, it all should be working properly :)
@qiukeren You can have troubles too if you try to share non-scalar types (like arrays or objects [Unirest\Response?])between main thread and Thread object. You can serialize the array/object in order to solve it ;)
Ahmad Nassri
@ahmadnassri
@fermino would be cool to read a blog post about it, happy to post it on the mashape blog and share with the community, if you're interested?
fermino
@fermino
English is not my first language, but well, i will try :D
Where can I send it?
Ahmad Nassri
@ahmadnassri
maybe try to write in a gist, i'll comment and give you feedback, then we can publish on the blog, send me the gist link in 1:1
Ionito
@Ionito
Hi Guys, I am trying to send img to an EmoVu api, this is my code http://screencast.com/t/Q8mfo8kWOFrK
But I'am getting errors http://screencast.com/t/6Bq2Wl1r It seems that the img could't be find, but it exist in my server
Also I tryied with external hosted path, but nothing change. Any Idea?
Ahmad Nassri
@ahmadnassri
try with the full path to the image? likely the PHP script is looking in a different path
possibly by default it only looks under the relative path where the class file is....
Ionito
@Ionito

Hi Ahmadrassri, now I am using this code

require_once 'Unirest.php';

Unirest\Request::verifyPeer(false); 

$headers = array("Accept" => "application/json",
                "X-Mashape-Key" => "ZTf4YXHi5smshQHhPVhwDeRhknqKp1jNhNijsnvkEeFFQec0iy",
                "LicenseKey" => "211199128197402830749336334523067115421133147181202030745339948223080xxxxx");

$body = array("imageFile" => Unirest\File::add("yo.jpg"));

$response = Unirest\Request::post("https://eyeris-emovu1.p.mashape.com/api/image/", $headers, $body);
var_dump($response);

And I am getting this response from the server http://screencast.com/t/7eNeUOBZ
No more the error in finding the image, but not the response that I need...
Any idea?

Ahmad Nassri
@ahmadnassri
that's a server error on the provider side
Ionito
@Ionito
but if I test the endpoint from the mashup page (https://www.mashape.com/eyeris/emovu-1) it is working http://screencast.com/t/IZDpKh193d5
I really don't know what is happen...
Ahmad Nassri
@ahmadnassri
try debugging with mockbin.com
see what data is being sent
Ionito
@Ionito
If I look with mockbin I recive http://screencast.com/t/7PsIm2Lxtcil and a lot of ilegible chars and finish with this: http://screencast.com/t/FXschf6O
Ahmad Nassri
@ahmadnassri
hmm, set the Accept header to json
but seems like that's a mockbin bug ... not able to decode the file
try with a text file (instead of image)
you want to make sure the uploading is working
and it may also be the image file is badly formatted
Ionito
@Ionito
I replaced the img with a txt and I the response is fine http://screencast.com/t/FPfWSC9LA9 . But the image is not the problem, I mean, when I upload from the Mashape Endpoint it works... mmm...
Ahmad Nassri
@ahmadnassri
I tried this with mockbin, seems like your code above works fine ...
I don't have a license key to Eyeris so I'm unable to test directly with them
Ahmad Nassri
@ahmadnassri
just tested with real license key ... seems to work fine
try a different image
Ahmad Nassri
@ahmadnassri
and looking at your example again (http://screencast.com/t/7eNeUOBZ), the error generated from the Service provider, they are throwing a 500, from an ASP.NET server ...
I realize this works from the website, but it really is nothing different to the way calls are made .. perhaps the encoding of the image file is troublesome and somehow the browser is over-compensating before sending (browsers tend to do that)
the website is doing regular XHR calls, nothing special, so it wouldn't be different than PHP