musement / api-documentation

Musement API documentation
https://api-docs.musement.com/
3 stars 7 forks source link

Accept-Language does not appear to work #14

Closed phil-newman closed 8 years ago

phil-newman commented 8 years ago

Using the example from the documentation:

GET /api/v3/cities/2
Accept-Language: es

...only returns English.

domis86 commented 8 years ago

Can you paste your request and response? I just tried and works fine:

GET https://api.musement.com/api/v3/cities/2
Accept-Language: es

 -- response --
200 OK
Content-Type:  text/xml; charset=UTF-8
Content-Length:  1712
Connection:  keep-alive
access-control-allow-origin:  *
Cache-Control:  max-age=259200, public, s-maxage=259200
Content-Encoding:  gzip
Date:  Wed, 13 Jul 2016 11:23:26 GMT
Etag:  W/"1990abb2eae8186adb2246035544df7c"
Last-Modified:  Wed, 13 Jul 2016 10:23:26 GMT
Server:  nginx/1.10.1
Vary:  Accept-Encoding,Accept-Language
Age:  236
X-Cache:  Hit from cloudfront
Via:  1.1 f83e672bbba2e0ea3294355a57e2ae80.cloudfront.net (CloudFront)
X-Amz-Cf-Id:  2kyzPKv6cpfrSg2tDz5UX9peOoDEKtj-ZZRgrExBM21k1etYGJUuWA==

<?xml version="1.0" encoding="UTF-8"?>
<result>
  <id>2</id>
  <top>true</top>
  <has_concierge>true</has_concierge>
  <name><![CDATA[Roma]]></name>
  <code><![CDATA[rome]]></code>
  <content><![CDATA[El más grande y asombroso museo al aire libre del mundo. Esta es Roma, la capital de Italia, primera gran metrópoli da la humanidad y una de las ciudades más amplias de Europa. Roma concentra sus tres milenios de historia en los testimonios arquitectónicos y artísticos que te dejan sin aliento, obras maestras que la convierten en una de las ciudades más visitadas y admiradas en el mundo. Hay quien dice que una vida no es suficiente para descubrir todos sus tesoros, y sin embargo, basta un sólo día para dejarse seducir por el encanto decadente y embriagador de la antigua capital de una de las civilizaciones antiguas más importantes, el Imperio Romano.Roma es la ciudad con la más alta concentración de bienes históricos y arquitectónicos del mundo. La lista de monumentos y sitios que ameritan ser visitados es infinita, pero algunos de ellos son verdaderamente imperdibles. Para no correr el riesgo de irte sin haber visto sus obras más importantes, ¡lo mejor que puedes hacer es ponerte en las manos de un guía experto de la ciudad!]]></content>
  <more><![CDATA[Empezando por el Coliseo, el anfiteatro más grande del mundo romano, reconocido como una de las siete maravillas del mundo moderno, la única en Europa. En los alrededores se encuentra el Foro Romano, lo que queda del centro comercial, religioso y político de la antigua Roma, corazón del complejo urbano de los Foros Imperiales, que se extendía entre el Capitolio y el Quirinal.Ciudad de hermosos jardines y antiguas villas nobles, como Villa Borghese, Roma es famosa también por sus fuentes monumentales, verdaderas joyas arquitectónicas. La más famosa es la Fontana di Trevi, en estilo rococó, espléndido escenario de la famosa escena de la película “La dolce vita” de Federico Fellini. No olvides lanzar una moneda, lo cual te garantizará regresar a la ¡“ciudad eterna”! Tampoco puedes dejar de visitar la Fontana dei Quattro Fiumi, una de las principales obras maestras de Gian Lorenzo Bernini, situada en el corazón de Plaza Navona, elegante punto de encuentro por la noche. Siempre llena de gente está también la Piazza di Spagna, con su escalera de Trinità dei Monti.Capital de las iglesias hermosas, Roma contiene la Ciudad del Vaticano, la cuna del cristianismo católico. Su obra maestra es la imponente Basílica di San Pietro, cuya cúpula, diseñada por Miguel Ángel, domina la entera Roma. El mismo Miguel Ángel realizó los famosos frescos de la Capilla Sixtina, teatro del cónclave para la elección del Papa.El corazón de la vida nocturna de esta ciudad profundamente viveur es Trastevere, antiguo barrio popular en la orilla oeste del río Tíber, un laberinto hermoso y brillante de calles estrechas y locales de moda.]]></more>
  <weight>12</weight>
  <latitude>41.8980000</latitude>
  <longitude>12.4830000</longitude>
  <country>
    <id>82</id>
    <name><![CDATA[Italia]]></name>
    <iso_code><![CDATA[IT]]></iso_code>
  </country>
  <cover_image_url><![CDATA[https://static1.musement.com/cover/0001/03/rome_event-2986.jpeg?event]]></cover_image_url>
  <url><![CDATA[https://www.musement.com/es/roma/]]></url>
</result>
phil-newman commented 8 years ago

From fiddler: Request

GET https://developers.musement.com/api/v3/cities/2 HTTP/1.1
Accept-Language: es
Host: developers.musement.com

Response

HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 2835
Connection: keep-alive
Access-Control-Allow-Origin: *
Cache-Control: max-age=259200, public, s-maxage=259200
Date: Wed, 13 Jul 2016 11:32:38 GMT
ETag: "639d13b6efe9f47d8da1d59a9ac54908"
Last-Modified: Wed, 13 Jul 2016 10:32:38 GMT
Musement-Server: 10.0.0.193
Server: nginx/1.8.1
Set-Cookie: musement_browser=%7B%22locale%22%3Afalse%2C%22currency%22%3A%22USD%22%2C%22country%22%3Afalse%2C%22ip_country%22%3A%22gb%22%2C%22color%22%3Afalse%7D; expires=Mon, 25-Jul-2016 11:32:38 GMT; Max-Age=1036800; path=/
Vary: Accept-Encoding,Accept-Encoding
Age: 232
X-Cache: Hit from cloudfront
Via: 1.1 b47ef3766a859c0c1ae31872e114e497.cloudfront.net (CloudFront)
X-Amz-Cf-Id: WmQ71pGH_8-7OPdv_wk8p-LXkCHNuoY7SyPF6645784786Iz6jhLeA==

{"id":2,"top":true,"has_concierge":true,"name":"Rome","code":"rome","content":"Rome is without doubt the largest and most impressive open-air museum in the world. The capital of Italy, the first great metropolis of humanity and one of the larger cities of Europe, Rome condenses its three millennia of history in architectural and artistic testimonies that leave you breathless, with masterpieces that make it one of the most visited cities in the world. Some say that one life is not enough to discover all the treasures hidden inside this incredible city. Just one day however is enough to be seduced by the exciting charm of the old capital of one of the most important ancient civilizations, the Roman Empire.Rome is the city with the highest concentration of historical and architectural landmarks in the world. The list of monuments and places worth visiting would be too long to mention, but some really just cannot be missed. Starting from the Colosseum, the largest amphitheater of the Roman world, recognized as one of the seven wonders of the modern world and the only one in Europe.","more":"Not far off is the Roman Forum, what remains of the financial, religious and political center of ancient Rome, the heart of the urban complex of the Imperial Forums, which extended between the Capitoline Hill and the Quirinal.A city with beautiful gardens and ancient aristocratic villas, like the Villa Borghese, Rome is also famous for its monumental fountains, real architectural gems. The most famous is the Trevi Fountain, in rococo style, that is known for being the setting of the most famous scene of 'La dolce vita', classic italian movie by Federico Fellini. Do not forget to throw a coin into this fountain. Legend has it that this will assure your return to the \"eternal city\"! Don't miss the Baroque Fountain of the Four Rivers, one of the greatest masterpieces of Gian Lorenzo Bernini, located in the heart of Piazza Navona, elegant meeting point in the evening. Piazza di Spagna is also very crowded and popular, with its Spanish Steps.Capital with beautiful churches, Rome includes the Vatican City, the cradle of Catholic Christianity. Its masterpiece is the imposing St. Peter's Basilica, whose dome, designed by Michelangelo, overlooks the whole of Rome. Michelangelo also signed the famous frescoes of the Sistine Chapel, the conclave for the Pope's election.The heart of nightlife in this pleasure-seeking city is Trastevere, a former working-class district on the west bank of the Tiber River, a beautiful and lively maze of narrow streets and trendy bars.","weight":12,"latitude":41.898,"longitude":12.483,"country":{"id":82,"name":"Italy","iso_code":"IT"},"cover_image_url":"https:\/\/images.musement.com\/cover\/0001\/03\/rome_event-2986.jpeg?event","url":"https:\/\/developers.musement.com\/us\/rome\/"}
phil-newman commented 8 years ago

it looks like it might be your caching policy because i also get cached data when changing currency using the X-Musement-Currency header

domis86 commented 8 years ago

"Accept-Language" should be fixed now. Can you retry?

phil-newman commented 8 years ago

yes Accept-Language does work now but still getting cached results for other headers

domis86 commented 8 years ago

@phil-newman can you retry with "X-Musement-Currency" now?

phil-newman commented 8 years ago

yep looks ok now. Thanks. :+1:

domis86 commented 8 years ago

OK, thanks for feedback!