Subversion Repositories SmartDukaan

Rev

Rev 10268 | Rev 10314 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10268 Rev 10307
Line 69... Line 69...
69
				 "{\"selling_price\""+":"+"\""+price+
69
				 "{\"selling_price\""+":"+"\""+price+
70
		 "\",}");
70
		 "\",}");
71
		 StringEntity input = null;
71
		 StringEntity input = null;
72
		 try {
72
		 try {
73
			 input = new StringEntity(jsonRequest.toString());
73
			 input = new StringEntity(jsonRequest.toString());
74
			 System.out.println("Json input " + jsonRequest.toString());
74
			 logger.info("Json input " + jsonRequest.toString());
75
		 } catch (UnsupportedEncodingException e) {
75
		 } catch (UnsupportedEncodingException e) {
76
			 e.printStackTrace();
76
			 logger.error("Unable to create request",e);
77
		 }
77
		 }
78
		 input.setContentType("application/json");
78
		 input.setContentType("application/json");
79
		 httppost.setEntity(input);
79
		 httppost.setEntity(input);
80
		 HttpResponse response = null;
80
		 HttpResponse response = null;
81
		 try {
81
		 try {
82
			 System.out.println("Before send " );
82
			 logger.info("Trying to post");
83
			 response = httpclient.execute(httppost);
83
			 response = httpclient.execute(httppost);
84
			 System.out.println("After send " );
-
 
85
		 } catch (IOException e) {
84
		 } catch (IOException e) {
86
			 e.printStackTrace();
85
			 logger.error("Unable to post request",e);
87
		 }
86
		 }
88
		 BufferedReader rd = null;
87
		 BufferedReader rd = null;
89
		 try {
88
		 try {
90
			 rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
89
			 rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()));
91
		 } catch (IllegalStateException e) {
90
		 } catch (IllegalStateException e) {