Recent

Author Topic: Invalid protocol version in response? What does it mean?  (Read 4257 times)

vonskie

  • Full Member
  • ***
  • Posts: 184
Invalid protocol version in response? What does it mean?
« on: September 08, 2017, 05:08:02 pm »
9:57:42 AM 09/08/2017 GET: http://rammb-slider.cira.colostate.edu/data/json/goes-16/full_disk/band_13/available_dates.json
9:58:32 AM 09/08/2017 ERROR: Exception class: EHTTPClient | Message: Invalid protocol version in response: ""


balazsszekely

  • Guest
Re: Invalid protocol version in response? What does it mean?
« Reply #1 on: September 08, 2017, 05:29:51 pm »
This works for me. The file is downloaded in your project directory:
Code: Pascal  [Select][+][-]
  1. uses fphttpclient;
  2.  
  3. procedure TForm1.Button1Click(Sender: TObject);
  4. var
  5.   FHTTPClient: TFPHTTPClient;
  6. begin
  7.   FHTTPClient := TFPHTTPClient.Create(nil);
  8.   try
  9.     FHttpClient.AllowRedirect := True;
  10.     try
  11.       FHTTPClient.Get('http://rammb-slider.cira.colostate.edu/data/json/goes-16/full_disk/band_13/available_dates.json', 'available_dates.json');
  12.     except
  13.     end;
  14.     if FHTTPClient.ResponseStatusCode = 200 then
  15.       ShowMessage('Successfully downloaded!');
  16.   finally
  17.     FHTTPClient.Free;
  18.   end;
  19. end;

vonskie

  • Full Member
  • ***
  • Posts: 184
Re: Invalid protocol version in response? What does it mean?
« Reply #2 on: September 11, 2017, 08:45:29 am »
Thank you for the sample, this site is really busy...


 

TinyPortal © 2005-2018