Muhammad Nabeel Arif
Muhammad Nabeel Arif

Reputation: 19310

How to read post curl request in android and read response

I am implementing a rest API and now I have to execute following request and then read the response from server. Can anybody guide me or provide me a piece of code to implement it in Android

$ curl `http://xyz.com:84545/api/locks/` 
 -X POST \
 -H "Date: Thu, 01 Mar 2012 01:23:45 GMT" 
 -H "Authorization: SABH ZW1haWxAaG9zdC5jb20Mohoehglsdofsdofjsdfjsdfjsdj DUzMjNhOTg=" \
 -H "Content-Type: application/json" \
 -d '{"i":0,"u":1,"h":1,"m":"2312312312","n":"Lock"}'

Upvotes: 1

Views: 1627

Answers (1)

Rajesh
Rajesh

Reputation: 15774

Use HttpClient. Code snippet can be found here.

Upvotes: 4

Related Questions