FlashDevelop receives XML, Flash Pro receives JSON -


i'm getting data feed client's supplier.
documention says can feed both in xml , in json, default xml. json have set header accept:application/json , remove accept:application/xml header.
have not set nor removed headers in code.
i'm using normal urlloader load feed.

when navigate feed url in browser, xml.
when run code in flashdevelop, xml.
when run exact same code in flash pro, json.

does have idea causing in flash pro? hidden setting can changed?
urlrequest.method has no impact. debug mode or not has no impact.
i'm stomped.

---------code tried------------

var header:urlrequestheader = new urlrequestheader("accept", "application/xml"); var headers:array = []; headers.push(header); urlreq.requestheaders = headers; urlreq.method = urlrequestmethod.post; 

--------- full load code -----------

_urlloader.addeventlistener(event.complete, validatefeedloaded); _urlloader.addeventlistener(ioerrorevent.io_error, handlefeedioerror); _urlloader.addeventlistener(securityerrorevent.security_error, handlefeedsecerror); var urlreq:urlrequest = new urlrequest(_feedurl); urlreq.requestheaders = [new urlrequestheader("accept", "application/json")]; _urlloader.load(urlreq); 

different clients/applications have different defaults. different versions of flash/air runtime may have different defaults accept type.

if need consistency, should explicitly set accept type in request:

urlrequest.requestheaders = [new urlrequestheader("accept", "application/json")]; 

this should ensure json in both ide's in whatever version of runtime you're using.


Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

serialization - Convert Any type in scala to Array[Byte] and back -

SonarQube Plugin for Jenkins does not find SonarQube Scanner executable -