2

all

I got the error when using grape.

This page contains the following errors:

error on line 1 at column 1: Document is empty
Below is a rendering of the page up to the first error.

in fact, My api works and return the xml well. and after sometime's running , it start to buggy. show that error. my server is nginx + passenger. rails2.3.8. + grape. any help?

dexterdeng
  • 249
  • 3
  • 13

1 Answers1

5

The error is from Chrome, displayed when content-type is xml and the xml is not well formed, or in your case as the error indicates, empty. Your api will still work from clients (such as curl) that do not parse and verify the content type.

It's best to hit your api with curl instead of a browser when you encounter something odd.

Krut
  • 4,112
  • 3
  • 34
  • 42
  • You sir are a livesaver! Digged around to find why a certain jQuery plugin already had problems with one stylesheet, then I read your comment and checked what the plugin really does after the transform: It converts it to XML. ;) – unexist Nov 25 '13 at 16:18