I have a sharepoint. It has a web address. It needs an username and password though. I’ve tried to access the site from dynamo by using “Web Request” node and this is what i’ve got:
I couldn’t find any solution so I decided to start a new topic. Do you have any ideas?
This is how the authorization process looks like in the web browser:
Post edited, this is all I know about the security there for now. I have some skills in python. The link you’ve sent would be a straight solution, but quick research shows that library “requests” doesn’t work with IronPython ;<
Yes, of course that’s a solution. I’m here for a more sophisticated result though ;p I thought that it would be great added value for a community which has an internet-accessible platform with project data.
Just wanted to point out the workaround if you were in a rush as it’s likely going to take some time to produce that setup as the various security methods require a series of steps which are complicated by IronPython’s inability to work with the method I sent over.
You would need to submit a web request with authorization tokens included. That node in Dynamo doesn’t support that. I think @Radu_Gidei1 might have some nodes in his package that can provide help with that.
Anyway thank you for the answer, I appreciate that
Thank you for your participation @Konrad_K_Sobon . Here’s what I’ve achieved so far. It looks like a simple python line can bring a similar result to the “Web Request” node mentioned before:
That’s the problem. According to my research and understanding this library “Requests” is not supported in IronPython for some reasons (some other libraries inside it)
OK guys. New day, fresh mind PROBLEM SOLVED
Thank you @Konrad_K_Sobon for the link, it made me look at its content once again!
I found the answer elsewhere though (from the source mentioned in your link). Here is my working ironpython code.
1 input as String
1 output as String
import clr
from System import *
from System.IO import *
from System.Net import *
dataEnteringNode = IN
response=[]
req = HttpWebRequest.Create(IN[0]) #THE LINK IS AN INPUT AS STRING
req.Method = "POST"
req.Credentials = NetworkCredential("USERNAME", "PASSWORD") #INSERT YOUR OWN
req.ContentType = "text/xml; charset=\"UTF-8\"";
req.UserAgent = "IronPython"
reqstm = req.GetRequestStream()
rsp = req.GetRponse();
try:
response=StreamReader(rsp.GetResponseStream()).ReadToEnd() #THE OUTPUT
finally:
rsp.Close()
OUT = response