Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6810391
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:12:01+00:00 2026-05-26T20:12:01+00:00

I have this controller: def list = { withFormat { xml { render Customer.list()

  • 0

I have this controller:

 def list = {

        withFormat {

            xml { render Customer.list() as XML }

            html {
                params.max = Math.min(params.max ? params.int('max') : 10, 100)
                [customerInstanceList: Customer.list(params), customerInstanceTotal: Customer.count()]
            }
        }

    }

Which basically shows me all customers in my webpage, but it is also aimed to list as xml for a rest response. I’m using WizTools Rest Client 2.33 to call list method via rest. What is happening here is, if I call the controller via browser, everything works fine and all customers are listed as html in the page. If I call it via rest, the response I get is the same html page code rendered. In the code above, I tried to take out the html part, and that way the rest response is what I expect (xml). So, I think something might be missing, because the controller is not being able to recognise a rest request. Any help would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:12:01+00:00Added an answer on May 26, 2026 at 8:12 pm

    The way withFormat works is by looking at, for lack of a better term, the action extension. If you want xml to return instead of html, you’re URL would need be something like:

    http://localhost/app/customer/list.xml

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code: def addcar @car = Car.new(params[:car]) render :action => 'list' end
I am getting some unexpected behavior from Html.EditorFor(). I have this controller: [HandleError] public
I have this in my controller. I need my view to generate some HTML,
I have this controller: class SchedulesController post, :except => :index def index #Schedules.create(:id =>
I have this in my controller: MyTestViewModel asdf = new MyTestViewModel { SomeTestDate =
In our code we used to have something like this: *(controller->bigstruct) = ( struct
I have this function on my controller (Im using CodeIgniter) that reads the database,
I have this code in my controller and want to test this code line
I have this command in a Rails controller open(source) { |s| content = s.read
I have a controller action that checks this.User.Identity.IsAuthenticated What do you suggest how to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.