File upload, although Box API 2.0 gives 200 as an answer instead of 302

I am trying to download a file from Box.com via the API using the following code.

<cfhttp url="https://api.box.com/2.0/files/(FILE_ID)/content/" method="GET" redirect="true" >
<cfhttpparam type="header" name="Authorization" value="Bearer (DEVELOPER_TOKEN)">
</cfhttp>

According to the documentation, he should return 302 Foundas an answer. And redirects to dl.boxcloud.com for download. But I get 200as an answer.

enter image description here

Not sure why I get 200 as an answer. I need to upload a file through an API call. Did I miss something?

+4
source share
1 answer

Regarding the comment by @ Miguel-F, I looked and found a solution from Ben Nadel's Post .

200, , ColdFusion dl.boxcloud.com( REDIRECT ), - 200.

, REDIRECT FALSE. Coldfusion .

, REDIRECT FALSE.

<cfhttp url="https://api.box.com/2.0/files/(FILE_ID)/content/" method="GET" redirect="false" >
<cfhttpparam type="header" name="Authorization" value="Bearer (DEVELOPER_TOKEN)">
</cfhttp>

302 found .

enter image description here

Location ( ) ResponseHeader. , URL- , , CFHEADER CFCONTENT.

: https://www.bennadel.com/blog/934-ask-ben-handling-redirects-with-coldfusion-cfhttp.htm

+2

Source: https://habr.com/ru/post/1674198/


All Articles