locked
HTTP/1.1 500 Internal Server Error when making a WebRequest at a proxy links? RRS feed

  • Question

  • User-1485098150 posted

    I have a Json that contains an array of objects,every object having a link that is accessing an mp4 movie on a server.For some of this links,when I make a webrequest,I receive a 500 Internal Server Error.

    I used Fiddler in order to debug the code and I have seen that all the links that contains proxy in the Host name throw this kind of error,while the other link that contains static in Host name do not throw this error.Also,I can access the proxy links in the browser,but I receive an error in the webrequest.

    This is what I receive in Fiddler in case of static links:

    HTTP/1.1 200 OK Server: Apache/2.2.15 (CentOS) X-Forwarded-For: 95.101.2.212 Content-Type: video/mp4 Accept-Ranges: bytes ETag: "fdda6-d897b6-4ce4f78025680" Last-Modified: Mon, 12 Nov 2012 17:16:58 GMT Content-Length: 14194614 Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET,OPTIONS Cache-Control: public, max-age=603910 Date: Sat, 10 Aug 2019 07:33:43 GMT Connection: keep-alive Access-Control-Allow-Origin: * Access-Control-Allow-Methods: GET,OPTIONS

    This is what I receive in the case of proxy links:

    HTTP/1.1 500 Internal Server Error X-Forwarded-For: 95.101.2.97 Content-Type: application/json;charset=utf-8 Access-Control-Allow-Origin: * Date: Sat, 10 Aug 2019 07:33:43 GMT Connection: close

    This is a screenshot from Fiddler that shows one link that worked and another that receive an error:https://i.imgur.com/GaZDDSk.png . This is the part of the code where I make a request where url is the link that i try to access:

     WebRequest request = WebRequest.Create(new Uri(vd.url));
    
          using (WebResponse response = request.GetResponse())
            {
               Console.WriteLine("{0} {1} {2}",e, response.ContentLength, response.ContentType);
            }

    What can I do in order to access those proxy links using a web request?I also realised that the link is making a redirect.In Transport header of the response is a link that the browser access.How can I access the redirect link from the Transport Header in webrequest ?
    I just realise that the link is making a redirect.In Transport header of the response is a link that the browser access.How can I access the redirect link from the transport Header in webrequest ? This is what I receive in Fiddler when I'm accessing the proxy link in the Browser:https://imgur.com/gallery/JDNvVbO This is what I receive in Fiddler after the browser make a redirect in the link from the Transport header : https://imgur.com/gallery/BdfYh0h The link in the transport header does nor appear when I try to access the link from my application.

    Sunday, August 11, 2019 5:08 AM

All replies