SimplifiedLogic / creoson

OpenSource Automation using JSON Transactions for PTC's CREO Parametric
http://www.creoson.com
MIT License
79 stars 23 forks source link

Access-Control-Allow-Origin Proper Technique #68

Open hickmanz opened 3 years ago

hickmanz commented 3 years ago

First of all I love the product and Im enjoying testing it. Second, I'm sorry for what is probably an obvious question to most.

Im building a small web app that makes requests to Creoson server using ajax. I'm hitting an issue with CORS and getting an error related to Creoson server not having Access-Control-Allow-Origin headers.

I understand that this is not really an error with creoson but I'd still like to understand if I am misunderstanding the intended use of making calls to the microserver. Should I be making calls a different way? Should I build a version that has less restrictive access control headers on the responses? The calls are made from an Excel add-in so I can't easily tell the browser to ignore the missing headers.

Thanks for your time, -Zack

phaleth commented 3 years ago

CORS issues are related to the web browser.

If you can take out the browser out of the equation then you can simply call Creoson server directly from MS Excel using WinHttp.WinHttpRequest.5.1 COM interface. I don't know much about Excel VBA, but I guess a good example is here https://simpleexcelvba.com/winhttp-request-get-your-site-status/

If you can take MS Excel out of the equation and you're not a programmer then I recommend AutoHotkey https://community.ptc.com/t5/3D-Part-Assembly-Design/CREOSON-Beta-3-is-Available/m-p/475720/highlight/true#M30431