title: Get JSON WebMap from ArcGIS JavaScript API Map object
body: <p>I'm trying to get a WebMap object (as JSON) from a JavaScript Map object in the ArcGIS JavaScript API.  Is there any way to do this within the API, without using ArcGIS.com? Ideally something like:</p>
  
  <pre><code>webMapAsJSON = map.toWebMap();
  </code></pre>
  
  <p><a href="http://sampleserver6.arcgisonline.com/arcgis/rest/services/Utilities/PrintingTools/GPServer/Export%20Web%20Map%20Task" rel="nofollow">From the "Export Web Map Task" documentation</a> in the REST API, there's this line that suggests it should exist:</p>
  
  <blockquote>
    <p>"The ArcGIS web APIs (for JavaScript, Flex, Silverlight, etc.) allow developers to easily get this JSON string from the map."</p>
  </blockquote>
  
  <p>However, I don't see anything in the Map object or elsewhere in the API that would do this.</p>