#URLMapping
Explore tagged Tumblr posts
Text
rray(b),d=0;d<b;d++)c[d]=arguments[d];if(c.length<2)throw new Error("Default value is required");var e=c[0],f=c[1];return g(a,e,f)}}}),null);
__d("sdk.feature",["JSSDKConfig","sdk.FeatureFunctor"],(function(a,b,c,d,e,f){a=b("sdk.FeatureFunctor").create(b("JSSDKConfig"));e.exports=a}),null);
__d("sdk.Scribe",["QueryString","UrlMap","sdk.Runtime","sdk.feature"],(function(a,b,c,d,e,f){f.log=a;function a(a,c,d){d===void 0&&(d=!1);if(c.extra!=null&&typeof c.extra==="object"){var e=c.extra;e.revision=b("sdk.Runtime").getRevision()}e=new Image();var f=b("UrlMap").resolve("www")+"/common/scribe_endpoint.php";b("sdk.feature")("epd_endpoint_migration",!1)&&(f=b("UrlMap").resolve("www")+"/platform/scribe_endpoint.php/",b("sdk.feature")("epd_omit_cookies",!1)&&!d&&(e.crossOrigin="anonymous"));e.src=b("QueryString").appendToUrl(f,{c:a,m:ES("JSON","stringify",!1,c)})}}),null);
__d("sdk.ErrorHandling",["sdk.ErrorHandler","sdk.Runtime","sdk.Scribe","sdk.feature"],(function(a,b,c,d,e,f){a=b("sdk.feature")("error_handling",!1);c=b("sdk.ErrorHandler").create(a,function(a){b("sdk.Scribe").log("jssdk_error",{appId:b("sdk.Runtime").getClientID(),error:a.name||a.message,extra:a})});e.exports=c}),null);
__d("FB",["DOMWrapper","GlobalCallback","JSSDKCssConfig","Log","dotAccess","sdk.Content","sdk.DOM","sdk.ErrorHandling","sdk.domReady"],(function(a,b,c,d,e,f){var g=window.FB={};c={};b("Log").setLevel(0);b("GlobalCallback").setPrefix("FB.__globalCallbacks");var h=document.createElement("div");b("DOMWrapper").setRoot(h);b("sdk.domReady")(function(){b("Log").info("domReady"),b("sdk.Content").appendHidden(h),b("JSSDKCssConfig").rules&&b("sdk.DOM").addCssRules(b("JSSDKCssConfig").rules,b("JSSDKCssConfig").components)});function i(a,c,d,e){return b("sdk.ErrorHandling").guard(function(){function f(a){if(Array.isArray(a))return a.map(f);return a&&typeof a==="object"&&a.__wrapped?a.__wrapped:typeof a==="function"&&/^function/.test(a.toString())?b("sdk.ErrorHandling").unguard(a):a}var g=Array.prototype.slice.call(arguments).map(f),h=a.apply(e,g),j,k=!0;if(h&&typeof h==="object"){j=Object.create(h);j.__wrapped=h;for(var d in h){var l=h[d];if(typeof l!=="function"||d==="constructor")continue;k=!1;j[d]=i(l,c+":"+d,d,h)}}return!k?j:k?h:j},c)}function a(a,c){var d=a?b("dotAccess")(g,a,!0):g;Object.keys(c).forEach(function(b){var e=c[b];if(typeof e==="function"){var f=(a?a+".":"")+b;f=i(e,f,b,c);f&&(d[b]=f)}else(typeof e==="object"||typeof e==="number")&&(d[b]=e)})}ES("Object","assign",!1,c,{provide:a});e.exports=c}),null);
__d("ArgumentError",["ManagedError"],(function(a,b,c,d,e,f){a=function(a){babelHelpers.inheritsLoose(b,a);function b(b,c){return a.call(this,b,c)||this}return b}(b("ManagedError"));e.exports=a}),null);
__d("flattenObject",[],(function(a,b,c,d,e,f){"use strict";e.exports=a;function a(a){var b={};for(var c in a)if(Object.prototype.hasOwnProperty.call(a,c)){var d=a[c];if(null===d||void 0===d)continue;else typeof d==="string"?b[c]=d:b[c]=ES("JSON","stringify",!1,d)}return b}}),null);
__d("URIRFC3986",[],(function(a,b,c,d,e,f){f.parse=a;var g=new RegExp("^([^:/?#]+:)?(//([^\\\\/?#@]*@)?(\\[[A-Fa-f0-9:.]+\\]|[^\\/?#:]*)(:[0-9]*)?)?([^?#]*)(\\?[^#]*)?(#.*)?");function a(a){if(a.trim()==="")return null;a=a.match(g);if(a==null)return null;var b={};b.uri=a[0]?a[0]:null;b.scheme=a[1]?a[1].substr(0,a[1].length-1):null;b.authority=a[2]?a[2].substr(2):null;b.userinfo=a[3]?a[3].substr(0,a[3].length-1):null;b.host=a[2]?a[4]:null;b.port=a[5]?a[5].substr(1)?parseInt(a[5].substr(1),10):null:null;b.path=a[6]?a[6]:null;b.query=a[7]?a[7].substr(1):null;b.fragment=a[8]?a[8].substr(1):null;b.isGenericURI=b.authority===null&&!!b.scheme;return b}}),null);
__d("createObjectFrom",[],(function(a,b,c,d,e,f){e.exports=g;function g(a,b){if(b===void 0)return g(a,!0);var c={};if(Array.isArray(b))for(var d=a.length-1;d>=0;d--)c[a[d]]=b[d];else for(var d=a.length-1;d>=0;d--)c[a[d]]=b;return c}}),null);
__d("URISchemes",["createObjectFrom"],(function(a,b,c,d,e,f){f.isAllowed=a;var g=b("createObjectFrom")(["aidemos","aistudio","blob","cmms","fb","fba","fbatwork","fb-ama","fb-workchat","fb-workchat-secure","fb-messenger","fb-messenger-public","fb-messenger-group-thread","fb-page-messages","fb-pma","fbcf","fbconnect","fbinternal","fbmobilehome","fbrpc","file","ftp","gtalk","http","https","mailto","wss","ms-app","intent","itms","itms-apps","lasso","market","svn+ssh","fbstaging","tel","sms","pebblejs","sftp","whatsapp","moments","flash","fblite","chrome-extension","webcal","fb124024574287414","fb124024574287414rc","fb124024574287414master","fb1576585912599779","fb929757330408142","designpack","fbpixelcloud","fbapi20130214","fb1196383223757595","oculus","oculus.store","oculus.feed","oculusstore","odh","skype","callto","workchat","fb236786383180508","fb1775440806014337","data","fb-mk","munki","kirigami","origami-file","fb-nimble-vrsrecorder","fb-nimble-monohandtrackingvis","together","togetherbl","venues","whatsapp-consumer","whatsapp-smb","fb-ide-opener","spark-studio"]);function a(a){return a==null||a===""?!0:Object.prototype.hasOwnProperty.call(g,a.toLowerCase())}}),null);
__d("setHostSubdomain",[],(function(a,b,c,d,e,f){e.exports=a;function a(a,b){a=a.split(".");a.length<3?a.unshift(b):a[0]=b;return a.join(".")}}),null);
__d("URIAbstractBase",["invariant","URIRFC3986","URISchemes","setHostSubdomain"],(function(a,b,c,d,e,f,g){var h,i,j=new RegExp("[\\x00-\\x2c\\x2f\\x3b-\\x40\\x5c\\x5e\\x60\\x7b-\\x7f\\uFDD0-\\uFDEF\\uFFF0-\\uFFFF\\u2047\\u2048\\uFE56\\uFE5F\\uFF03\\uFF0F\\uFF1F]"),k=new RegExp("^(?:[^/]*:|[\\x00-\\x1f]*/[\\x00-\\x1f]*/)"),l=[];a=function(){"use strict";a.parse=function(c,d,e,f){if(!d)return!0;if(d instanceof a){c.setProtocol(d.getProtocol());c.setDomain(d.getDomain());c.setPort(d.getPort());c.setPath(d.getPath());c.setQueryData(f.deserialize(f.serialize(d.getQueryData())));c.setFragment(d.getFragment());c.setIsGeneric(d.getIsGeneric());c.setForceFragmentSeparator(d.getForceFragmentSeparator());c.setOriginalRawQuery(d.getOriginalRawQuery());c.setQueryParamModified(!1);return!0}d=d.toString().trim();var g=(h||(h=b("URIRFC3986"))).parse(d)||{fragment:null,scheme:null,query:null};if(!e&&!(i||(i=b("URISchemes"))).isAllowed(g.scheme))return!1;c.setProtocol(g.scheme||"");if(!e&&j.test(g.host||""))return!1;c.setDomain(g.host||"");c.setPort(g.port||"");c.setPath(g.path||"");if(e)c.setQueryData(f.deserialize(g.query||"")||{});else try{c.setQueryData(f.deserialize(g.query||"")||{})}catch(a){return!1}c.setFragment(g.fragment||"");g.fragment===""&&c.setForceFragmentSeparator(!0);c.setIsGeneric(g.isGenericURI||!1);c.setOriginalRawQuery(g.query);c.setQueryParamModified(!1);if(g.userinfo!==null){if(e)throw new Error("URI.parse: invalid URI (userinfo is not allowed in a URI): "+d);return!1}if(!c.getDomain()&&c.getPath().indexOf("\\")!==-1){if(e)throw new Error("URI.parse: invalid URI (no domain but multiple back-slashes): "+d);return!1}if(!c.getProtocol()&&k.test(d)){if(e)throw new Error("URI.parse: invalid URI (unsafe protocol-relative URLs): "+d+"'");return!1}if(c.getDomain()&&c.getPath()&&!ES(c.getPath(),"startsWith",!0,"/")){if(e)throw new Error("URI.parse: invalid URI (domain and path where path lacks leading slash): "+d);return!1}return!0};a.tryParse=function(b,c){var d=new a(null,c);return a.parse(d,b,!1,c)?d:null};a.isValid=function(b,c){return!!a.tryParse(b,c)};function a(b,c){c||g(0,2966),this.$9=c,this.$7="",this.$1="",this.$6="",this.$5="",this.$3="",this.$4=!1,this.$8={},this.$2=!1,a.parse(this,b,!0,c),this.$11=!1}var c=a.prototype;c.setProtocol=function(a){(i||(i=b("URISchemes"))).isAllowed(a)||g(0,11793,a);this.$7=a;return this};c.getProtocol=function(){return(this.$7||"").toLowerCase()};c.setSecure=function(a){return this.setProtocol(a?"https":"http")};c.isSecure=function(){return this.getProtocol()==="https"};c.setDomain=function(a){if(j.test(a))throw new Error("URI.setDomain: unsafe domain specified: "+a+" for url "+this.toString());this.$1=a;return this};c.getDomain=function(){return this.$1};c.setPort=function(a){this.$6=a;return this};c.getPort=function(){return this.$6};c.setPath=function(a){this.$5=a;return this};c.getPath=function(){return this.$5};c.addQueryData=function(a,b){Object.prototype.toString.call(a)===
0 notes
Link
A REST (Representational State Transfer) resource is an abstraction of a piece of information or an action such as a single data record, a collection of records, or a query. Each resource in REST API is identified by a named Uniform Resource Identifier (URI) and accessed using standard HTTP methods (HEAD, GET, POST, PATCH, DELETE). REST API is based on the usage of resources, their Uniform Resource Identifiers (URIs), and the links between them. You can use a resource to interact with your Salesforce org. For instance, you can perform actions such as: Retrieve summary information about the Application programming interface (API) versions available to you. Obtain detailed information about a Salesforce object, such as Account, User, or a custom object. Perform a query or search. Update or delete records. A REST request consists of four components: a resource URI, an HTTP method, request headers, and a request body. Request headers specify metadata for the request. The request body specifies data for the request, when necessary. If there’s no data to specify, the body is omitted from the request. Basically, Restful services are REST architecture based on Web Services. RESTful web services are lightweight, highly scalable, and maintainable and are used to craft APIs for web-based applications. Benefits of Restful Web Services Fast: RESTful Web Services are fast because there are no strict specifications like SOAP. It uses less bandwidth and resources. Language and platform-independent: RESTful web services can be written in any programming language and run on any platform. Can use SOAP: RESTful web services can use SOAP (Simple Object Access Protocol) web services as the implementation tools. Allows various data formats: RESTful web service allows various data formats such as Plain text, HTML, XML, and JSON. Apex REST Methods Apex REST supports two formats for representations of resources: JSON and XML. JSON representations are passed by default in the body of a request or response and the format is indicated by the Content-Type property in the HTTP header. You can retrieve the body as a Blob from the HttpRequest object if there are no parameters to the Apex method. If parameters are defined in the Apex method, an attempt is made to deserialize the request body into those parameters. If the Apex method has a non-void return type, the resource representation is serialized into the response body. These return and parameter types are allowed: Apex primitives (excluding sObject and Blob). sObjects Lists or maps of Apex primitives or sObjects (only maps with String keys are supported). User-defined types that contain member variables of the types listed above. Methods annotated with @HttpGet or @HttpDelete should have no parameters. This is because GET and DELETE requests have no request body, so there’s nothing to deserialize. A single Apex class annotated with @RestResource can’t have multiple methods annotated with the same HTTP request method. For example, the same class can’t have two methods annotated with @HttpGet. Example: You can use user-defined types for parameters in your Apex REST methods. Apex REST deserializes request data into public, private, or global class member variables of the user-defined type unless the variable is declared as static or transient. For example, an Apex REST method that contains a user-defined type parameter might look like the following: @RestResource(urlMapping=’/user_defined_type_example/*’) global with sharing class MyOwnTypeRestResource { @HttpPost global static MyUserDefinedClass echoMyType(MyUserDefinedClass ic) { return ic; } global class MyUserDefinedClass { global String string1; global String string2 { get; set; } private String privateString; global transient String transientString; global static String staticString; } } Valid JSON and XML request data for this method would look like: { “ic” : { “string1” : “value for string1”, “string2” : “value for string2”, “privateString” : “value for privateString” }} Conclusion REST stands for Representational State Transfer. REST is used to build lightweight, well-maintained and scalable web services. The main aspects of REST are the resources on the server and the verbs GET, POST, PUT, and DELETE which can be used to work with these resources. Visual Studio and .NET can be used to build Restful Web Services. If you are looking for certified Salesforce developers or Salesforce implementation partners, Cloud Analogy — the world’s leading and most successful Salesforce Development Company — would be the right choice for you. The post What are REST Web Services? appeared first on AkshayDhiman .Com.
0 notes