title: Request type over curl - Trying to get xml file to output/download correctly
body: <p>So I'm building an app that phrases an xml file... It needs to get the file with curl.</p>
  
  <p>I'm using this command:</p>
  
  <pre><code>curl -L -o /Users/MyName/Desktop/fileName.xml  http://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&amp;requestType=retrieve&amp;format=xml&amp;stationString=KPHX&amp;hoursBeforeNow=1
  </code></pre>
  
  <p>First off, <a href="http://www.aviationweather.gov/adds/dataserver" rel="nofollow">here's a link</a> to their api</p>
  
  <p>And also <a href="http://www.aviationweather.gov/adds/dataserver/current" rel="nofollow">here's some of their examples</a></p>
  
  <p>When I view the data server url in my browser it shows up fine.</p>
  
  <p><a href="http://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&amp;requestType=retrieve&amp;format=xml&amp;stationString=KPHX&amp;hoursBeforeNow=1" rel="nofollow">http://www.aviationweather.gov/adds/dataserver_current/httpparam?dataSource=metars&amp;requestType=retrieve&amp;format=xml&amp;stationString=KPHX&amp;hoursBeforeNow=1</a></p>
  
  <p>but when I curl it I get this:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;Response&gt;
    &lt;request_index&gt;548652&lt;/request_index&gt;
    &lt;data_source name="server" /&gt;
    &lt;request type="status" /&gt;
    &lt;errors&gt;
      &lt;error&gt;requestType parameter required&lt;/error&gt;
    &lt;/errors&gt;
    &lt;warnings&gt;
      &lt;warning&gt;Request type not specified, defaulting to status&lt;/warning&gt;
      &lt;warning&gt;Data source not specified, defaulting to server&lt;/warning&gt;
    &lt;/warnings&gt;
    &lt;time_taken_ms&gt;0&lt;/time_taken_ms&gt;
    &lt;response /&gt;
  &lt;/Response&gt;
  </code></pre>
  
  <p>instead of whats showing up in my browser which is this</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;response xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XML-Schema-instance" version="1.2" xsi:noNamespaceSchemaLocation="http://aviationweather.gov/adds/schema/metar1_2.xsd"&gt;
    &lt;request_index&gt;550259&lt;/request_index&gt;
    &lt;data_source name="metars" /&gt;
    &lt;request type="retrieve" /&gt;
    &lt;errors /&gt;
    &lt;warnings /&gt;
    &lt;time_taken_ms&gt;3&lt;/time_taken_ms&gt;
    &lt;data num_results="3"&gt;
      &lt;METAR&gt;
        &lt;raw_text&gt;KPHX 120551Z 08007KT 10SM CLR 12/01 A3002 RMK AO2 SLP161 T01170011 10211 20117 58004&lt;/raw_text&gt;
        &lt;station_id&gt;KPHX&lt;/station_id&gt;
        &lt;observation_time&gt;2014-01-12T05:51:00Z&lt;/observation_time&gt;
        &lt;latitude&gt;33.43&lt;/latitude&gt;
        &lt;longitude&gt;-112.02&lt;/longitude&gt;
        &lt;temp_c&gt;11.7&lt;/temp_c&gt;
        &lt;dewpoint_c&gt;1.1&lt;/dewpoint_c&gt;
        &lt;wind_dir_degrees&gt;80&lt;/wind_dir_degrees&gt;
        &lt;wind_speed_kt&gt;7&lt;/wind_speed_kt&gt;
        &lt;visibility_statute_mi&gt;10.0&lt;/visibility_statute_mi&gt;
        &lt;altim_in_hg&gt;30.02067&lt;/altim_in_hg&gt;
        &lt;sea_level_pressure_mb&gt;1016.1&lt;/sea_level_pressure_mb&gt;
        &lt;quality_control_flags&gt;
          &lt;auto_station&gt;TRUE&lt;/auto_station&gt;
        &lt;/quality_control_flags&gt;
        &lt;sky_condition sky_cover="CLR" /&gt;
        &lt;flight_category&gt;VFR&lt;/flight_category&gt;
        &lt;three_hr_pressure_tendency_mb&gt;-0.4&lt;/three_hr_pressure_tendency_mb&gt;
        &lt;maxT_c&gt;21.1&lt;/maxT_c&gt;
        &lt;minT_c&gt;11.7&lt;/minT_c&gt;
        &lt;metar_type&gt;SPECI&lt;/metar_type&gt;
        &lt;elevation_m&gt;336.0&lt;/elevation_m&gt;
      &lt;/METAR&gt;
      &lt;METAR&gt;
        &lt;raw_text&gt;KPHX 120451Z 00000KT 10SM CLR 13/01 A3003 RMK AO2 SLP162 T01280006&lt;/raw_text&gt;
        &lt;station_id&gt;KPHX&lt;/station_id&gt;
        &lt;observation_time&gt;2014-01-12T04:51:00Z&lt;/observation_time&gt;
        &lt;latitude&gt;33.43&lt;/latitude&gt;
        &lt;longitude&gt;-112.02&lt;/longitude&gt;
        &lt;temp_c&gt;12.8&lt;/temp_c&gt;
        &lt;dewpoint_c&gt;0.6&lt;/dewpoint_c&gt;
        &lt;wind_dir_degrees&gt;0&lt;/wind_dir_degrees&gt;
        &lt;wind_speed_kt&gt;0&lt;/wind_speed_kt&gt;
        &lt;visibility_statute_mi&gt;10.0&lt;/visibility_statute_mi&gt;
        &lt;altim_in_hg&gt;30.029528&lt;/altim_in_hg&gt;
        &lt;sea_level_pressure_mb&gt;1016.2&lt;/sea_level_pressure_mb&gt;
        &lt;quality_control_flags&gt;
          &lt;auto_station&gt;TRUE&lt;/auto_station&gt;
        &lt;/quality_control_flags&gt;
        &lt;sky_condition sky_cover="CLR" /&gt;
        &lt;flight_category&gt;VFR&lt;/flight_category&gt;
        &lt;metar_type&gt;METAR&lt;/metar_type&gt;
        &lt;elevation_m&gt;336.0&lt;/elevation_m&gt;
      &lt;/METAR&gt;
      &lt;METAR&gt;
        &lt;raw_text&gt;KPHX 120351Z 00000KT 10SM CLR 14/01 A3004 RMK AO2 SLP166 T01390006&lt;/raw_text&gt;
        &lt;station_id&gt;KPHX&lt;/station_id&gt;
        &lt;observation_time&gt;2014-01-12T03:51:00Z&lt;/observation_time&gt;
        &lt;latitude&gt;33.43&lt;/latitude&gt;
        &lt;longitude&gt;-112.02&lt;/longitude&gt;
        &lt;temp_c&gt;13.9&lt;/temp_c&gt;
        &lt;dewpoint_c&gt;0.6&lt;/dewpoint_c&gt;
        &lt;wind_dir_degrees&gt;0&lt;/wind_dir_degrees&gt;
        &lt;wind_speed_kt&gt;0&lt;/wind_speed_kt&gt;
        &lt;visibility_statute_mi&gt;10.0&lt;/visibility_statute_mi&gt;
        &lt;altim_in_hg&gt;30.041338&lt;/altim_in_hg&gt;
        &lt;sea_level_pressure_mb&gt;1016.6&lt;/sea_level_pressure_mb&gt;
        &lt;quality_control_flags&gt;
          &lt;auto_station&gt;TRUE&lt;/auto_station&gt;
        &lt;/quality_control_flags&gt;
        &lt;sky_condition sky_cover="CLR" /&gt;
        &lt;flight_category&gt;VFR&lt;/flight_category&gt;
        &lt;metar_type&gt;SPECI&lt;/metar_type&gt;
        &lt;elevation_m&gt;336.0&lt;/elevation_m&gt;
      &lt;/METAR&gt;
    &lt;/data&gt;
  &lt;/response&gt;
  </code></pre>
  
  <p>Sorry if this is kind of a long post, just not the easiest to explain.</p>