jeudi 30 avril 2015

Error 502 Wistia video upload

I am trying to upload a video via Wistia's api and I am getting a 502.

public function send_video($file) {

    $data["file"]           = $file;
    $data["project_id"]     = "123";
    $data["api_password"]   = "123";


    return self::get_json_response($data);
}


public function get_json_response($data) {

    $headers["Content-Type"] = "multipart/form-data";

    $http_transport_util = new HTTP_TRANSPORT_UTIL();
    $has_success = $http_transport_util->post("http://ift.tt/1kQPR4I",$data,$headers,"username","password");

    $http_response = $http_transport_util->get_http_response();

//Just prints the out the response which can be seen below p($http_response);

    $code = $http_transport_util->get_http_response()->get_code();

    die;

HTTP_RESPONSE Object ( [_code] => 502 [_header] => HTTP_HEADER Object ( [iterationStyle] => lowerCase [fields:protected] => Array ( [Content-Type] => multipart/form-data,text/html [Cache-Control] => no-cache [X-Served] => bakery-breadroute-naan )

        [camelCase:protected] => 
        [lowerCase:protected] => 
    )

[_request_header] => HTTP_HEADER Object
    (
        [iterationStyle] => lowerCase
        [fields:protected] => Array
            (
                [0] => POST / HTTP/1.1
                [1] => Authorization: Basic 123
                [2] => Host: upload.wistia.com
                [3] => Accept: */*
                [4] => Content-Type:multipart/form-data
                [5] => Content-Length: 202
                [6] => 
                [7] => file=D%253A%252FProjects%252Fwhitefire%252Fdata%252Ftemp%252F54483cfd0b5403d8dba98e7bcbeeec02%252Fclipcanvas_14348_offline.mp4&project_id=3131231&api_password=1234
            )

        [camelCase:protected] => 
        [lowerCase:protected] => 
    )

[_cookies] => Array
    (
    )

[_body] => <html><body><h1>502 Bad Gateway</h1>

The server returned an invalid or incomplete response.

[_http_version] => 
[_path] => 
[_uri] => 

)

Aucun commentaire:

Enregistrer un commentaire