inakiabt / etsy-php

Etsy API wrapper for PHP
74 stars 59 forks source link

submitTracking error 411 Length Required #50

Open sandism opened 5 years ago

sandism commented 5 years ago
$api->submitTracking(array('params' => 
            array(
            'shop_id' => $shop,
            'receipt_id' => $receipt,
            'tracking_code' => $code,
            'carrier_name' => $carrier,
            )));

response

Fatal error: Uncaught Etsy\EtsyRequestException: [1]:### Invalid auth/bad request (got a 411, expected HTTP/1.1 20X or a redirect): Array ( ) <!DOCTYPE html> <strong>Error 411</strong> (Length Required)!!1</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/RobertVDK"><img src="https://avatars.githubusercontent.com/u/32244118?v=4" />RobertVDK</a> commented <strong> 4 years ago</strong> </div> <div class="markdown-body"> <p>I am receiving the same issue. Any resolve to this?</p> </div> </div> <div class="comment"> <div class="user"> <a rel="noreferrer nofollow" target="_blank" href="https://github.com/shopifychamp"><img src="https://avatars.githubusercontent.com/u/30862211?v=4" />shopifychamp</a> commented <strong> 4 years ago</strong> </div> <div class="markdown-body"> <p>Hi sandism, You need to put post content in data index for post/put request. Please refer below code:</p> <pre><code>$return = $this->api->submitTracking( array( 'params' => array( "receipt_id"=> "16999999", ), 'data' => array( "tracking_code"=>"9400109202020999999999", "carrier_name"=> "4px", ) ) ); print_r($return);</code></pre> <p>Please let me know if you need any help.</p> <p>Thanks Kshitij</p> </div> </div> <div class="page-bar-simple"> </div> <div class="footer"> <ul class="body"> <li>© <script> document.write(new Date().getFullYear()) </script> Githubissues.</li> <li>Githubissues is a development platform for aggregating issues.</li> </ul> </div> <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js"></script> <script src="/githubissues/assets/js.js"></script> <script src="/githubissues/assets/markdown.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/highlight.min.js"></script> <script src="https://cdn.jsdelivr.net/gh/highlightjs/cdn-release@11.4.0/build/languages/go.min.js"></script> <script> hljs.highlightAll(); </script> </body> </html>