I currently have JSON like the following (from the Australia Post developer guide):
"PickupDetails_v1.Header":
{ "Common_v1.UserName": "testuser",
"Common_v1.AccessKey": "xxxxxxxxx",
"Common_v1.CustomerID": 123 }
I'd like to know what the best approach is to being able to have an object in JS without the namespaces (e.g. PickupDetails_v1) when retrieving data from the API and vice versa when sending data. Basically I'd like to be able to know the best way to be able to customize JSON property names in Angular.
For example:
var pickupDetails = { UserName: "testuser"; AccessKey: "xxxxxxx" };
$http.post(pickupDetails, "http://www.example.com/postageDetails"); // Should send the pickup details with the namespaces).
var storedPickupDetails = $http.get("http://www.example.com/postageDetails"); // Should have the same properties as pickupDetails.