Skip to main content
We are trying to send http request using POST method

We have added remote site setting for end point and disable security protocol also.

Endpoint server does not have any security and authentication. 

We are getting below response. 

Status=Forbidden, StatusCode=403

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

<html><head>

<meta type="copyright" content="Copyright (C) 1996-2016 The Squid Software Foundation and contributors">

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">

<title>ERROR: The requested URL could not be retrieved</title>

<style type="text/css"><!--

 /*

 * Copyright (C) 1996-2016 The Squid Software Foundation and contributors

 *

 * Squid software is distributed under GPLv2+ license and includes

 * contributions from numerous individuals and organizations.

 * Please see the COPYING and CONTRIBUTORS files for details.

 */

/*

 Stylesheet for Squid Error pages

 Adapted from design by Free CSS Templates

 http://www.freecsstemplates.org

 Released for free under a Creative Commons Attribution 2.5 License

*/

/* Page basics */

* {

    font-family: verdana, sans-serif;

}

html body {

    margin: 0;

    padding: 0;

    background: ⌗efefef;

    font-size: 12px;

    color: ⌗1e1e1e;

}

/* Page displayed title area */

⌗titles {

    margin-left: 15px;

    padding: 10px;

    padding-left: 100px;

    background: url('/squid-internal-static/icons/SN.png') no-repeat left;

}

/* initial title */

⌗titles h1 {

    color: ⌗000000;

}

⌗titles h2 {

    color: ⌗000000;

}

/* special event: FTP success page titles */

⌗titles ftpsuccess {

    background-color:⌗00ff00;

    width:100%;

}

/* Page displayed body content area */

⌗content {

    padding: 10px;

    background: ⌗ffffff;

}

/* General text */

p {

}

/* error brief description */

⌗error p {

}

/* some data which may have caused the problem */

⌗data {

}

/* the error message received from the system or other software */

⌗sysmsg {

}

pre {

    font-family:sans-serif;

}

/* special event: FTP / Gopher directory listing */

⌗dirmsg {

    font-family: courier;

    color: black;

    font-size: 10pt;

}

⌗dirlisting {

    margin-left: 2%;

    margin-right: 2%;

}

⌗dirlisting tr.entry td.icon,td.filename,td.size,td.date {

    border-bottom: groove;

}

⌗dirlisting td.size {

    width: 50px;

    text-align: right;

    padding-right: 5px;

}

/* horizontal lines */

hr {

    margin: 0;

}

/* page displayed footer area */

⌗footer {

    font-size: 9px;

    padding-left: 10px;

}

body

:lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; }

:lang(he) { direction: rtl; }

 --></style>

</head><body id=ERR_ACCESS_DENIED>

<div id="titles">

<h1>ERROR</h1>

<h2>The requested URL could not be retrieved</h2>

</div>

<hr>

<div id="content">

<p>The following error was encountered while trying to retrieve the URL: <a href="http://xxx.xxx.xxx.x:XXXX/tempdropfile">http://xxx.xxx.xxx.x:XXXX/tempdropfile</a></p>

<blockquote id="error">

<p><b>Access Denied.</b></p>

</blockquote>

<p>Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect.</p>

<p>Your cache administrator is <a href="mailto:support@salesforce.com?subject=CacheErrorInfo%20-%20ERR_ACCESS_DENIED&body=CacheHost%3A%20proxy-dfw.net.salesforce.com%0D%0AErrPage%3A%20ERR_ACCESS_DENIED%0D%0AErr%3A%20%5Bnone%5D%0D%0ATimeStamp%3A%20Fri,%2028%20Feb%202020%2013%3A32%3A34%20GMT%0D%0A%0D%0AClientIP%3A%2010.247.60.16%0D%0A%0D%0AHTTP%20Request%3A%0D%0APOST%20%2Ftempdropfile%20HTTP%2F1.1%0AUser-Agent%3A%20SFDC-Callout%2F48.0%0D%0ASFDC_STACK_DEPTH%3A%201%0D%0AContent-Type%3A%20multipart%2Fform-data%3B%20boundary%3DA_RANDOM_STRING%0D%0ACache-Control%3A%20no-cache%0D%0APragma%3A%20no-cache%0D%0AAccept%3A%20text%2Fhtml,%20image%2Fgif,%20image%2Fjpeg,%20*%3B%20q%3D.2,%20*%2F*%3B%20q%3D.2%0D%0AProxy-Connection%3A%20keep-alive%0D%0AContent-Length%3A%204225%0D%0AX-Forwarded-For%3A%2010.220.213.74%0D%0AHost%3A%20192.168.250.8%3A8081%0D%0A%0D%0A%0D%0A">support@salesforce.com</a>.</p>

<br>

</div>

<hr>

<div id="footer">

<p>Generated Fri, 28 Feb 2020 13:32:34 GMT by proxy-dfw.net.salesforce.com (squid)</p>

<!-- ERR_ACCESS_DENIED -->

</div>

</body></html>

We are trying to send CSV file to server by below code

String fileName = 'Claim Data.csv';

String fileContent = '"63124","LABOR CLAIM","MII WNTY CLAIMS","2018-08-07 00:00:00"'+

'"58330","PART CLAIM","MII WNTY CLAIMS","2019-08-06 00:00:00"';

String separationString = 'A_RANDOM_STRING';

// assemble the body payload

String header = '--' + separationString + '\nContent-Disposition: form-data; name="file"; filename="' + fileName + '"\nContent-Type: text/csv\n\n';

String body = system.EncodingUtil.base64Encode(blob.valueOf(fileContent)) + '\n';

String footer = '--' + separationString + '--';

String bodyPayload = header + body + footer;

// send out the request

HttpRequest req = new HttpRequest();

req.setHeader('Content-Type', 'multipart/form-data; boundary=' + separationString);

req.setMethod('POST');

req.setEndpoint(targetURL);

req.setBody(bodyPayload);

Http http = new Http();

httpresponse res=http.send(req);

system.debug(res.getbody());   

 
1 Antwort
  1. 24. Apr. 2020, 05:30
    HI Pallavi,

    Below troubleshooting approach can help:

    >>Can you share more information about the debug logs?

    >>Can you confirm that certificates are not expired? The certificate chain at End point URL should also be working fine.

    >> Do they show the chain of certificate at SSL shopper and digicert.(Check them at https://www.sslshopper.com/ssl-checker.html⌗hostname=

    https://www.digicert.com/help/)

    >> Is the endpoint URL functional and not down?

    >>You can try to change the END point URL at Request bin and capture the request ( https://requestbin.com/r) and isolate if its an issue at salesforce end or third party.

     

    Hope this helps you. Please mark this answer as best so that others facing the same issue will find this information useful.

     

    Thank you
0/9000