glenelkins Posted July 23, 2010 Share Posted July 23, 2010 Hi For the life of me I cannot work out why the following code is returning the following error: Request Entity Too Large The requested resource /api/rest/1.2/sandbox/prepare does not allow request data with POST requests, or the amount of data provided in the request exceeds the capacity limit. Additionally, a 413 Request Entity Too Large error was encountered while trying to use an ErrorDocument to handle the request. The strange thing is the API needs a POST request and this is saying it is not allowed? The api document for this preparing of the sandbox is here: https://sandbox.clickbank.com/rest/1.2/sandbox <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://api.clickbank.com/rest/1.2/sandbox/prepare"); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml", "Authorization:DEV-219F7E04857FADEEDAC74A48E2CFAD6EBFEF:API-DDA02BA4D7F9C2F7CAD1E7C1BA0CE478B56A")); $result = curl_exec($ch); curl_close($ch); print $result; ?> Link to comment https://forums.phpfreaks.com/topic/208662-clickbank-api/ Share on other sites More sharing options...
RaythMistwalker Posted July 23, 2010 Share Posted July 23, 2010 i think most likely the request is too large Link to comment https://forums.phpfreaks.com/topic/208662-clickbank-api/#findComment-1090109 Share on other sites More sharing options...
glenelkins Posted July 23, 2010 Author Share Posted July 23, 2010 hi that answer is not really helpful! Link to comment https://forums.phpfreaks.com/topic/208662-clickbank-api/#findComment-1090111 Share on other sites More sharing options...
kiopa Posted November 27, 2010 Share Posted November 27, 2010 Found your post via Google as I was having the same problem. In case you haven't solved it yet, it's because you need to use the host sandbox.clickbank.com, not api.clickbank.com. ClickBank docs don't seem to mention this though (or at least I didn't see it). So the actual request URL should be: https://sandbox.clickbank.com/rest/1.2/sandbox/prepare Hope that helps! Link to comment https://forums.phpfreaks.com/topic/208662-clickbank-api/#findComment-1140283 Share on other sites More sharing options...
jasen Posted November 22, 2011 Share Posted November 22, 2011 The Authorization: header is malformed, it should have a space after the first colon. Link to comment https://forums.phpfreaks.com/topic/208662-clickbank-api/#findComment-1290617 Share on other sites More sharing options...
requinix Posted November 23, 2011 Share Posted November 23, 2011 The Authorization: header is malformed, it should have a space after the first colon. No. Leading whitespace is recommended but not required. Link to comment https://forums.phpfreaks.com/topic/208662-clickbank-api/#findComment-1290633 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.