POST requests: Send objects in FormData

36 views
Skip to first unread message

Ashesh Ambasta

unread,
Mar 2, 2015, 9:18:28 AM3/2/15
to spray...@googlegroups.com
I have a simple use case where I have to POST to an API that expects complex objects in the form;

For example, it expects objects like (json);

opening_hours: {
  monday
: ["5:00_1_open", "09:00_1_closed", "12:00_1_open", "21:00_1_closed"],
  tuesday
: "closed"
},
picture
: {
  url
: "http://somewhere.com/picture.jpg"
}


You get the flow. I've been using FormData to create send form parameters, but it only accepts parameters of type Map[String, String]. What's the best way to overcome this?
Reply all
Reply to author
Forward
0 new messages