How to send json object with username and password for rest login webservice in iphone?
I have to use REST web service also I have to use json object for sending username and password to login web service. I have done in android with following code.   

	

    HttpClient client = new DefaultHttpClient();
                		String responseBody;
                		JSONObject jObj = new JSONObject();
                		
                		try
                		{
                			HttpPost post = new HttpPost("http://localhost:8080/MTA/login");
                	        jObj.put("email", "deepak.pawar@creatywa.com");
                	        jObj.put("password", "GL176W3F9X");
                
                	        StringEntity se = new StringEntity(jObj.toString());  
                
                	        post.setEntity(se);
                	        post.setHeader(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
                	        post.setHeader("Content-type", "application/json");
                	        System.out.println("webservice request executing");
                
                	        ResponseHandler responseHandler = new BasicResponseHandler();
                	        responseBody = client.execute(post, responseHandler);
                	        
                	        System.out.println("Response : " + responseBody);
                	        /* 
                	         * You can work here on your responseBody
                	         * if it's a simple String or XML/JSON response
                	         */
                
                		}
                		catch(Exception e)
                		{
                			System.out.println("Exception : " + e);
                		}


I have to do same in iPhone. How i can do in this iPhone? If anyone knows please help me. I will appreciate to him/her.



How to send json object with username and password for rest login webservice in iphone?
===

I have to use REST web service also I have to use json object for sending username and password to login web service. I have done in android with following code.   

	

    HttpClient client = new DefaultHttpClient();
                		String responseBody;
                		JSONObject jObj = new JSONObject();
                		
                		try
                		{
                			HttpPost post = new HttpPost("http://localhost:8080/MTA/login");
                	        jObj.put("email", "deepak.pawar@creatywa.com");
                	        jObj.put("password", "GL176W3F9X");
                
                	        StringEntity se = new StringEntity(jObj.toString());  
                
                	        post.setEntity(se);
                	        post.setHeader(new BasicHeader(HTTP.CONTENT_TYPE, "application/json"));
                	        post.setHeader("Content-type", "application/json");
                	        System.out.println("webservice request executing");
                
                	        ResponseHandler responseHandler = new BasicResponseHandler();
                	        responseBody = client.execute(post, responseHandler);
                	        
                	        System.out.println("Response : " + responseBody);
                	        /* 
                	         * You can work here on your responseBody
                	         * if it's a simple String or XML/JSON response
                	         */
                
                		}
                		catch(Exception e)
                		{
                			System.out.println("Exception : " + e);
                		}


I have to do same in iPhone. How i can do in this iPhone? If anyone knows please help me. I will appreciate to him/her.


