Home > cannot parse > cannot parse inputstream due to i/o error as json document

Cannot Parse Inputstream Due To I/o Error As Json Document

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up RallyDev: Unable to create defect. Server says “Cannot parse input …” up vote 3 down vote favorite Original Post: I'm trying to create defects programmatically. I am getting a couple errors and having trouble getting any further. Here, essentially, is the code: import requests, json rally_auth = ('my_user', 'my_pw') rally_auth_url = 'https://rally1.rallydev.com/slm/webservice/v2.0/security/authorize' rally_defect = 'https://rally1.rallydev.com/slm/webservice/v2.0/defect/defect' workspace_ref = 'https://rally1.rallydev.com/slm/webservice/v2.0/workspace/12345' fe_project_ref = 'https://rally1.rallydev.com/slm/webservice/v2.0/project/7890' current_fe_release_ref = "https://rally1.rallydev.com/slm/webservice/v2.0/release/45678" r = requests.get(rally_auth_url, auth=rally_auth) token = r.json()['OperationResult']['SecurityToken'] url = rally_defect + '/create?key=' + token payload = { 'Name': 'My defect', 'State': 'Open', 'Project': fe_project_ref, 'Rank': 120, 'Release': current_fe_release_ref, 'key': token } headers = {'content-type': 'application/json'} r = requests.post(url, data=json.dumps(payload), auth=rally_auth, headers=headers) You'll notice that i've put the token in both the POST's URL and data. The API docs say that I should have the key in the URL, but if I do not include the key in the POST data I get: {"CreateResult": {"_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "Errors": ["Not authorized to perform action: Invalid key"], "Warnings": []}} If I do include the key, the API request falls over differently. It will fail on the first comma. {"CreateResult": {"_rallyAPIMajor": "2", "_rallyAPIMinor": "0", "Errors": ["Cannot parse input stream due to I/O error as JSON document: Parse error: expected '}' but saw ',' [ chars read = >>>{\"Name\": \"My defect\",<<< ]"], "Warnings": []}} I am baffled. Fixed code Thanks to @nickm import requests, json rally_auth = ('my_user', 'my_pw') rally_auth_url = 'https://rally1.rallydev.com/slm/webservice/v2.0/security/authorize' rally_defect = 'https://rally1.rallydev.com/slm/webservice/v2.0/defect/defe

here for a quick overview of the site Help Center Detailed answers to any questions you might have Meta Discuss the workings and policies of this site About Us Learn more about Stack Overflow the company Business Learn more about hiring developers or posting ads with us Stack Overflow Questions Jobs Documentation Tags Users Badges Ask Question x Dismiss Join the Stack Overflow Community Stack Overflow is a community of 4.7 million programmers, just like you, helping each other. Join them; it only takes a minute: Sign up Rally http://stackoverflow.com/questions/22573359/rallydev-unable-to-create-defect-server-says-cannot-parse-input Test case result update using Rest API up vote 2 down vote favorite 1 There is a Rest Webservice URI for Test case result update in Rally. https://rally1.rallydev.com/slm/webservice/v2.0/testcaseresult/create Can some one tell me what should be the payload for this? May be point me to a working example. I have searched this a lot for 2 days and could not find the information what http://stackoverflow.com/questions/26979217/rally-test-case-result-update-using-rest-api I want. The closest is: Rally add test case results in bulk using web services API But however this did not help too.. java web-services rest testing rally share|improve this question asked Nov 17 '14 at 18:19 Mike 24821633 add a comment| 1 Answer 1 active oldest votes up vote 2 down vote What is your payload? What is the error you receive? The post you refer to was correct for previous versions of WS API. v2.0 does not support XML, only JSON. Minimally, the following fields must be set in the payload "{"TestCaseResult":{"Build":"1","Date":"2014-09-04T19:56:05.000Z","TestCase":"/testcase/12358743669","Verdict":"Pass"}}" Here is a full curl example. where double quotes are being escaped on Windows: curl --header "zsessionid:_abc123" -H "Content-Type: application/json" -d"{\"TestCaseResult\":{\"Build\":\"1.0\",\"TestCase\":\"/testcase/12358743669\",\"Date\":\"2014-09-04T19:56:05.000Z\",\"Verdict\":\"Pass\"}}" https://rally1.rallydev.com/slm/webservice/v2.0/TestCaseResult/create Since you used a java tag in your post, here is an example based on Rally Java toolkit. public class addTCRtoTC { public static void main(String[] args) throws URISyntaxException, IOException { String host = "https://rally1.rallydev.com"; String username = "user@co.com"; String password = "secret"; String wsapiVersion = "v2.0"; String projectRef = "/project/2222"; String workspaceRef = "/workspace/11111"; String applicationName = "RestExample_AddTCR"; RallyRestApi restApi = new RallyRestApi( new URI(host), username, password); restApi.setWsapiVersion(wsapiVersion); restApi.setApplicationName(applicationName); //Read User QueryReq

from GoogleSign inHidden fieldsSearch for groups or messages

 

Related content

cannot parse error text processing

Cannot Parse Error Text Processing p Support Search GitHub This repository Watch Star Fork processing processing Code Issues Pull requests Projects Wiki Pulse Graphs New issue incorrect classpath Closed Spiris opened this Issue Jul middot comments Projects None yet Labels None yet Milestone No milestone Assignees No one assigned participant Spiris commented Jul Working on a fresh install of on Windows bit tried loading up an old sketch tried making a new simple sketch both give me the same error Cannot parse error text incorrect classpath lib incorrect classpath lib -- simple reinstall fixed the issue Spiris closed this Jul

cannot parse the file photoshop error

Cannot Parse The File Photoshop Error table id toc tbody tr td div id toctitle Contents div ul li a href File-format Module Cannot Parse The File Png Photoshop a li li a href Could Not Place The Document Because The File-format Module Cannot Parse The File a li li a href File Format Module Cannot Parse The File Cs a li li a href The File Format Module Cannot Parse The File After Effects a li ul td tr tbody table p ElementsAdobe Dreamweaver Adobe MuseAdobe Animate CCAdobe Premiere ProAdobe After EffectsAdobe IllustratorAdobe InDesignView all communitiesExplore Menu beginsMeet the

cannot parse file error

Cannot Parse File Error table id toc tbody tr td div id toctitle Contents div ul li a href Cannot Parse The File Photoshop Png a li li a href File Format Cannot Parse The File a li li a href Photoshop Cannot Parse File Jpg a li li a href File-format Module Cannot Parse The File a li ul td tr tbody table p Complete Your Request Because The File-Format Module Cannot Parse The File MrJayBusch SubscribeSubscribedUnsubscribe K Loading Loading Working Add relatedl to Want to watch this again later Sign cannot parse the file photoshop error in to

eps cannot parse error

Eps Cannot Parse Error p Join INTELLIGENT WORK FORUMSFOR COMPUTER PROFESSIONALS Log In Come Join Us Are you aComputer IT professional Join Tek-Tips Forums Talk With Other Members Be Notified relatedl Of ResponsesTo Your Posts Keyword Search One-Click Access To YourFavorite parser module cannot parse the file eps Forums Automated SignaturesOn Your Posts Best Of All It's Free Join Us Tek-Tips's functionality error cannot parse response depends on members receiving e-mail By joining you are opting in to receive e-mail Posting Guidelines Promoting selling recruiting coursework unable to parse the postscript and thesis posting is forbidden Tek-Tips Posting Policies Jobs

error cannot parse service data

Error Cannot Parse Service Data table id toc tbody tr td div id toctitle Contents div ul li a href Cannot Parse Upload Response It May Contain Invalid Data a li li a href Cannot Parse Sip Address For User Information a li ul td tr tbody table p -Clone This Bug -Last Comment First Last Prev relatedl Next This bug is not in your error cannot parse response last search results Bug - czap fails to parse channel config Summary photoshop error cannot parse file czap fails to parse channel config Status CLOSED ERRATA Aliases None Product Fedora Classification

error cannot parse xml no element found

Error Cannot Parse Xml No Element Found p I just installed a -nodes cluster with SLES- -for-VMware and HA-extension CDs My configuration relatedl is plain vanilla I just specified 'bindnetaddr' and 'mcastaddr' cannot parse xml scanner state not recognized in the conffile and started Corosync openais Corosync seems to work domdocument cannot parse xml corosync MAIN Corosync Cluster Engine ' ' started and ready to provide service corosync MAIN Corosync built-in features nss corosync MAIN Successfully configured openais services to load corosync MAIN Successfully read main configuration file ' etc corosync corosync conf' corosync TOTEM Initializing transport UDP IP corosync