curlautodesk-forgeautodesk-realitycapture

Error message requesting for download link for Autodesk Forge, Reality Capture API


I have just completed processing a photoscene, but when I try to retrieve the OBJ file from the downlink, I find it is an error file instead. I don't understand what it means about an anonymous GET requests.

Can someone help me out?

curl -s $FORGE_URL/photo-to-3d/v1/photoscene/5Hq3Z7fTmzLuUbKD564PmirBmNjyhMTAGzyvcl3kBCg?format=obj " . "-H 'Content-Type: application/json' " . "-H 'Authorization: Bearer $access_token' "

the resulting file (result.obj.zip) is:

<?xml version="1.0" encoding="UTF-8"?>
<Error>
    <Code>InvalidRequest</Code>
    <Message>Request specific response headers cannot be used for anonymous GET requests.</Message>
    <RequestId>E7127B72F224C27A</RequestId>
    <HostId>djRejqsBaI0eQ/M+kLuftyfaHw2gVOOoUGkoPXgVgP9nNhmATe9QS4AlhnZTtNYh49zU4Avd1PU=</HostId>
</Error>

Solution

  • Try again and remove the Content-Type from the header.

    Per RFC 7231 section 3.1.5.5 Content-Type should be set only for PUT and POST requests. GET requests should have no body payload and hence be without Content-Type specified.