0

I want to send json object in the http url link as below

http://domainname/xyz?abc=[{"State":"Ap","LastName":"S","FirstName":"James","Email":"[email protected]","Country":"India","City":"Hyd","Barcode":"6598","RecordId":"1234"},{"State":"MP","LastName":"K","FirstName":"Singham","Email":"[email protected]","Country":"India","City":"GN","Barcode":"123","RecordId":"123456","FollowupTypes":"Send Sample;Followup Types"}]

any one help to send a request like this

Thanking you

1
  • use URLEncoding for parameter abc Commented Aug 16, 2012 at 8:00

1 Answer 1

1

I would recommend using Google's gson to encode your object (or array) in json and then add it to the URL :

String url = "http://domainname/xyz?abc=" + URLEncoder.encode(gson.toJson(yourObj), "UTF-8");

You may also use the new Android Json Writer.

Sign up to request clarification or add additional context in comments.

1 Comment

+1 Google gson is really intuitive and works well on Android!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.