Hi ,
I am writing Java code for calling ROR APIs …
I have written Java code to get all the blogs by
public List<BlogBean> getBlogsXml() {
return
webResource.path(ConfigurationUtil.LIST_BLOGS).header(ConfigurationUtil.AUTHENTICATION_HEADER,
authentication)
.accept(MediaType.APPLICATION_XML_TYPE).get(new
GenericType<List>() {
});
}
where in my Configuration.Utilfile
LIST_BLOGS will be http://localhost:3000/api/blogs.xml
now i trying to fetch the blogs that matches a field value for the blogs
My blogs table contains a field slug so that those keyowrd that matches
this will be returned.FOr this i received the input slug and now i need
to append this slug with my path in the COnfigurationUTIL file
LIST_BLOGS_SLUG = “http://localhost:3000/api/blogs/.xml”
how should i do this… Below is my code for receiving the slug parameter
public List<BlogBean> showBlog_slug(String slug)
{
return
webResource.path(ConfigurationUtil.LIST_BLOGS_SLUG).header(ConfigurationUtil.AUTHENTICATION_HEADER,
authentication)
.accept(MediaType.APPLICATION_XML_TYPE).get(new
GenericType<List>() {
});
}