- Home /
Twitter crossdomain.xml not found?
I have been attempting to send a WWW request to Twitter in order to post an update. I am sending it to the URL "http://" + username + ":" + password + "@twitter.com/statuses/update.json", with username and password set to an account name and password. However, the request returns an error - it says no crossdomain.xml file was found. However it does appear to exist (at http://twitter.com/crossdomain.xml) Does anyone know what the problem is here?
Answer by jashan · Feb 07, 2011 at 03:47 PM
The crossdomain.xml that Twitter has on their site is:
<?xml version="1.0" encoding="UTF-8"?>
<cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.adobe.com/xml/schemas/PolicyFile.xsd">
<allow-access-from domain="twitter.com" />
<allow-access-from domain="api.twitter.com" />
<allow-access-from domain="search.twitter.com" />
<allow-access-from domain="static.twitter.com" />
<site-control permitted-cross-domain-policies="master-only"/>
<allow-http-request-headers-from domain="*.twitter.com" headers="*" secure="true"/>
</cross-domain-policy>
So unless you access twitter.com from a Web player that is hosted from twitter.com, api.twitter.com, search.twitter.com or static.twitter.com (or *.twitter.com), it simply won't work.
So, what you'll have to do to access Twitter from a Web player is to write a Web service that reads the data for you, hosted on your own server. Then, on that server, you can provide access via a crossdomain.xml that has your Web player location in the "allow-access-from"-list.
So basically what you're saying is, normal people who don't have our own servers can't trivially post to twitter. :( Boooo.
Answer by heks · Dec 20, 2010 at 09:21 PM
This is related to the new security model that was added to Unity 3.0. You can read more about it here: http://unity3d.com/support/documentation/Manual/Security%20Sandbox.html
Basically in order for you to be able to access a resource on a server via Unity (in your case twitter.com), that server's crossdomain.xml would have to specify an all access '*' in order for the request to be successful via Unity.
Your answer
Follow this Question
Related Questions
POST data via WWWForm is not working for Twitter OAuth process. 1 Answer
Error when creating http request. GET request with custom headers is not supported. 3 Answers
get twitter access token 1 Answer
Is HTTPS supported on Windows Store through WWW? 0 Answers
Issue with WWW-Class' slow response time 2 Answers