<@UHP0BBX54> Use case? Getting url to do what exac...
# suitescript
a
@ec Use case? Getting url to do what exactly and which url?
e
It’s a 1.0 equivalent to “https.get” in 2.0. I have the URL; I’m simply requesting the URL (ie GET). However, the server redirects to another url and expects you to pass a cookie along with it. This cookie is unknown to me at the time of the request; it is returned along with a 302 response from the server; that is then used to make another request. The 302 is handled by the browser in the background, you don’t see anything happening if done in the browser. In Netsuite, however, I get back just a 403 response (meaning, it redirected already to the newly obtained url from the 302 response, without including the cookie).
a
@ec That does not tell me your USE case, maybe what you are trying to do is possible to do it in a whole different way with NetSuite.
e
Trying to download a PDF file from Sharepoint. Does that help? The files are open, but I cannot download them. Thanks for your help!
a
@ec You can't download files from Sharepoint with Server-Side scripts in NetSuite... because SharePoint does not allow Token Based Authentication to their API, it requires user intervention...
@ec You should be able to do that but you will need a Client Script handling that...
e
Files are totally open. It’s a Sharepoint site for which I have a “download” link
I’m simply trying to fetch the file via a GET
a
Try that download link in Postman and you will see you will get the same Auth issue.
e
same issue, correct
curl, not
a
@ec Being there, did that... no possible with Server-Side script and Sharepoint, but if you find a way, please share.
e
! thanks @alien4u
we have found, @alien4u that all we need is the FedAuth cookie, and if we pass the cookie along with the headers of the request it works. We just need a good way to figure out how to request that cookie… which is why I was asking if there’s a way to get Netsuite to behave nicely with the initial redirect/302 response