<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic REST requests through pyRevit in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/rest-requests-through-pyrevit/m-p/9231735#M37561</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm trying to create a pyRevit button which uses some information I'm getting from a website api using REST requests.&lt;/P&gt;&lt;P&gt;All is working fine when I'm just requesting and running the code on Visual Studio Code, but once I try to turn the whole thing into a button it seams like it doesn't recognize the 'requests' module.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I've been searching and searching but didn't find any information about how to import a module pyRevit doesn't recognize automatically or about a different inherent module suitable for my needs.&lt;/P&gt;&lt;P&gt;Would really appreciate any advise about the matter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached a print screen of the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Ifat.&lt;/P&gt;</description>
    <pubDate>Sun, 05 Jan 2020 15:05:12 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-01-05T15:05:12Z</dc:date>
    <item>
      <title>REST requests through pyRevit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rest-requests-through-pyrevit/m-p/9231735#M37561</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm trying to create a pyRevit button which uses some information I'm getting from a website api using REST requests.&lt;/P&gt;&lt;P&gt;All is working fine when I'm just requesting and running the code on Visual Studio Code, but once I try to turn the whole thing into a button it seams like it doesn't recognize the 'requests' module.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I've been searching and searching but didn't find any information about how to import a module pyRevit doesn't recognize automatically or about a different inherent module suitable for my needs.&lt;/P&gt;&lt;P&gt;Would really appreciate any advise about the matter.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached a print screen of the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Ifat.&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jan 2020 15:05:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rest-requests-through-pyrevit/m-p/9231735#M37561</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-05T15:05:12Z</dc:date>
    </item>
    <item>
      <title>Re: REST requests through pyRevit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rest-requests-through-pyrevit/m-p/9231803#M37562</link>
      <description>&lt;P&gt;Is the requests module something that you built yourself?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If not, have you researched as to whether the requests module you're using is compatible with ironpython?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There's not much more I can say without digging through your code. Having worked with pyRevit and revitpythonshell in the past, a very common issue is compatibility with the ironpython implementation.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 05 Jan 2020 16:34:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rest-requests-through-pyrevit/m-p/9231803#M37562</guid>
      <dc:creator>bhprest</dc:creator>
      <dc:date>2020-01-05T16:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: REST requests through pyRevit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rest-requests-through-pyrevit/m-p/9239774#M37563</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;No, I haven't built it myself.&lt;BR /&gt;BUT in the meanwhile I managed to figure out how to use WebRequest to get the info from the API, now I'm struggling to understand how to post info back to the api &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;There isn't enough solid info about using WebRequest with IronPython out there, at least not enough for a newbie...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Ifat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 10:18:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rest-requests-through-pyrevit/m-p/9239774#M37563</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-09T10:18:58Z</dc:date>
    </item>
    <item>
      <title>Re: REST requests through pyRevit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rest-requests-through-pyrevit/m-p/9254853#M37564</link>
      <description>&lt;P&gt;Ok found it! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Found this link:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.ironpython.info/index.php?title=Submit_a_POST_form_and_download_the_result_web_page" target="_blank" rel="noopener"&gt;http://www.ironpython.info/index.php?title=Submit_a_POST_form_and_download_the_result_web_page&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After lot's of trial and error I managed to figure out how to adjust it to my needs.&lt;/P&gt;&lt;P&gt;If you need to add headers to a request, you'll have to create a WebHeaderCollection and add the header to it like you would to a dictionary:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;whc&amp;nbsp;=&amp;nbsp;WebHeaderCollection()&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;whc[aut]&amp;nbsp;=&amp;nbsp;tok&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;req&amp;nbsp;=&amp;nbsp;WebRequest.Create(url)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;req.Headers&amp;nbsp;=&amp;nbsp;whc&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;Then you proceed with the example from the link.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;Ifat.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jan 2020 14:15:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rest-requests-through-pyrevit/m-p/9254853#M37564</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-16T14:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: REST requests through pyRevit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rest-requests-through-pyrevit/m-p/11364676#M37565</link>
      <description>&lt;P&gt;I think I am in a similar situation as you were. I'm not wanting to pull any info from Revit, I'm just wanting to send data to Notion.&amp;nbsp;I have a working script in VS Code, but when I placed it in my folder structure it didn't work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think it has to do with the imported libraries and maybe python3 vs ironpython. The libraries I'm using are 'requests' and 'json'. The link you posted didn't work, do I just need to follow the instructions you provided for the script to work?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the GitHub script link if you want to view the code for reference--&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/kslifter/Python" target="_blank"&gt;https://github.com/kslifter/Python&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 17 Aug 2022 14:17:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rest-requests-through-pyrevit/m-p/11364676#M37565</guid>
      <dc:creator>Ian_H</dc:creator>
      <dc:date>2022-08-17T14:17:55Z</dc:date>
    </item>
    <item>
      <title>Re: REST requests through pyRevit</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/rest-requests-through-pyrevit/m-p/13295333#M37566</link>
      <description>&lt;P&gt;the github link or this link&lt;BR /&gt;&lt;A href="http://www.ironpython.info/index.php?title=Submit_a_POST_form_and_download_the_result_web_page" target="_blank"&gt;http://www.ironpython.info/index.php?title=Submit_a_POST_form_and_download_the_result_web_page&lt;/A&gt;&lt;BR /&gt;are not working, can you attach example code so request will work?&lt;/P&gt;</description>
      <pubDate>Sun, 02 Feb 2025 13:33:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/rest-requests-through-pyrevit/m-p/13295333#M37566</guid>
      <dc:creator>Yanir_Studio</dc:creator>
      <dc:date>2025-02-02T13:33:34Z</dc:date>
    </item>
  </channel>
</rss>

