Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 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)

  • Sep 15 2021 12:45

    hutchic on travis_exfiltrate

    travis exfiltrate (compare)

  • Aug 24 2021 13:45
    develper1 opened #155
  • Aug 24 2021 13:21
    develper1 opened #154
  • Jun 02 2021 12:54
  • Jun 02 2021 12:50
    brockhaus synchronize #153
  • Jun 02 2021 12:34
  • Jun 02 2021 12:29
    brockhaus synchronize #153
Ionito
@Ionito
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
Anish
@anishtr4
Can you some one help me

<?php
require_once 'vendor/mashape/unirest-php/src/Unirest.php';
$response = Unirest\Request::get("https://webaroo-send-message-v1.p.mashape.com/sendMessage?message=asdddds&phone=9945297098",
array(
"X-Mashape-Key" => "my key",
"Accept" => "application/json"
),
array(
"txt" => "great value in its price range!"
)
);

var_dump($response);

?>

the aboce code shwoing an error "Missing Mashape application key. Go to http:\/\/docs.mashape.com\/api-keys to learn how to get your API application key."}" } } "
i used real key generated from mashape
Ahmad Nassri
@ahmadnassri
did you try the curl request with the same key? to verify that works or not as well
Anish
@anishtr4
sory iam new to php can you give me the code please
Ahmad Nassri
@ahmadnassri
i can in a bit ... currently in transit
Anish
@anishtr4
Ok
Anish
@anishtr4
@ahmadnassri please share the code hen you are free .....am stuck with this isuude
Anish
@anishtr4
anyone is there for helping me ?
Jesse Cory
@1xRUN
Hello - anyone around?
Ahmad Nassri
@ahmadnassri
hello :)
frankdee
@frankdee
Guys, when doing Request::curlOpt(CURLOPT_FOLLOWLOCATION, false); it gets ignored as the 'default' cURL settings ($curlOpts) are not merged (with higher prio) with the array from the curl_setopt_array(..) call on Line 411 in Request.php
Ahmad Nassri
@ahmadnassri
hmm i thought this was addressed...
ah
i see it
tests running: Mashape/unirest-php#86
Ahmad Nassri
@ahmadnassri
frankdee
@frankdee
@ahmadnassri great! thanks a lot for the quickfix :smiley:
frankdee
@frankdee
added a pull request #88 for some further fixes it took to get it to work
Ahmad Nassri
@ahmadnassri
@frankdee thanks! made some comments on that PR
frankdee
@frankdee
updated the code for the PR @ahmadnassri
Ahmad Nassri
@ahmadnassri
cool, i'll review and merge
thx
frankdee
@frankdee
nice, thx - will there be a new tag?
Ahmad Nassri
@ahmadnassri
yep, already released