Map<String, String> args = new HashMap<>(); args.put("url","http://www.mymappingapplication.com"); args.put("title","My Mapping Application"); args.put("type","Web Mapping Application"); args.put("tags","web, mapping, application"); args.put("token",token.token); // generated from /rest/generateToken MultipartContent content = new MultipartContent(); content.addPart(new MultipartContent.Part(new UrlEncodedContent(args))); System.out.println( "URL>>"+item.toURI() ); request = requestFactory.buildPostRequest(item, content); HttpResponse out = request.execute();
{"error":{"code":400,"messageCode":"GWM_0001","message":"Specified output format 'json' not supported.","details":[]}}
Did you ever find a solution? I ask because I have a similar problem. Documentation is sparse and, so far, not useful.
Ryan,
please note that this question was posted to the ArcGIS API for Javascript group. Regardless, I think you have an incorrect URL as the first part should point to the user content url (<usercontent-url>). Follow the SDK links to track down the full url:
//<usercontent-url>/addItem
//<content-url>/users/<username>/addItem
//<root-url>/content/users/<username>/addItem
//www.arcgis.com/sharing/rest//content/users/<username>/addItem
Also, since we're dealing with an operation specific to a user I normally use the organization url instead of "www.arcgis".