can anyboy tell me the equivalent of this in flex
curl –insecure –request POST –basic -u testuser@mydomain.com:password –header “Content-Type:application/xml” –data-binary “@c:\curl\examples\New_Activity.xml” https://beta.12sprints.com/v1/activities
basicaly this ia a api in which i need to send the user credentials and a xml file containing the data(new_activity)
for the credentials i tried to add it as a header authencation and encoding it to base64
var enc:Base64Encoder = new Base64Encoder();
enc.encode(“saurav.das@sap.com” + “:” + password);
myservice.headers[“Authorization”] =”basic “+enc.toString();
myservice.send();
but that too doesn`t work…
please help..
just_a_dude has the Authentication part, but the xml in his sample doesn’t work with the current 12sprints API, and it shouldn’t be Base64 encoded. Here’s a modified version of his sample that works (just change the username/password):