Questions tagged [idhttp]

This is the Indy component for HTTP requests.

TIdHTTP is a component of the Internet Direct (aka "Indy") open source library for performing HTTP requests. The component can handle redirects, authentication, and data retrieval all by itself.

IO Handlers can be attached for SSL, streaming, or custom designed IO.

268 questions
5
votes
2 answers

How to get response content even if connection gives error in IdHttp?

When using TIdHttp like this: Memo1.Text := IdHTTP1.post(url,data); I can get response content to memo1 if it doesn't give http error. But when it gives http bad request, Indy doesn't give me content. I'm also using try..except but it only prevent…
Someone
  • 728
  • 2
  • 12
  • 23
5
votes
2 answers

Http get json into string

I'm trying to get json response via HTTP GET method to a string but all I got is that: I'm using a code like that: memo1.Text:= idhttp1.Get('http://blabla.com/bla.php'); it returns json data. i need to get that json response to memo1. How can I do…
Someone
  • 728
  • 2
  • 12
  • 23
5
votes
1 answer

IdHTTP Access Violation on Disconnect

Indy 10: two threads, thread 1 is calling Get on an TIdHTTP and blocked reading data. thread 2 will call disconnect on the same TIdHTTP in order to interrupt the Get. I'm using Digest Authentication on the TIdHTTP and i get an AV…
Mike Davis
  • 197
  • 11
4
votes
1 answer

delphi : Connect to yahoo web messenger with idhttp

i use delphi xe2 and write a simple code to connect to yahoo web messenger but i get this message If you are seeing this page, your browser settings prevent you from automatically redirecting to a new UR procedure TForm2.Button1Click(Sender:…
lord_viper
  • 1,139
  • 1
  • 9
  • 13
4
votes
1 answer

How do I include a file in a TIdMultiPartFormDataStream for use with Indy IdHTTP1.Post?

What is the correct code that I need to use to send one or more files of any type along with other parameters using Indy's idHTTP.post? (using Delphi 2009 and Indy 10) The post in question calls a function in a commercial company's API…
user2834566
  • 775
  • 9
  • 22
4
votes
1 answer

TidHTTP Error Handling

I'm writing a program to perform checks on websites to test they're current status, e.g. 200 OK. I'm using Indy HTTP shipped with Delphi 2010 for this task and have the current code. procedure TCheckSiteIndividual.Execute; var http :…
Flatlyn
  • 2,040
  • 6
  • 40
  • 69
4
votes
1 answer

IdHTTP how to send raw body

How i can use IdHTTP to send message as PostMan dos below: My first attempt was as follow: function TIdFoo.SendIM(const AID, AMessage: string): Boolean; const _URL = 'https://URL.com/SendMessage'; var Params : TStringStream; Response :…
RepeatUntil
  • 2,272
  • 4
  • 32
  • 57
4
votes
2 answers

Delphi: Using Google URL Shortener with IdHTTP - 400 Bad Request

I'm trying to access the URL Shortener ( http://goo.gl/ ) via its API from within Delphi. However, the only result I get is: HTTP/1.0 400 Bad Request (reason: parseError) Here is my code (on a form with a Button1, Memo1 and IdHTTP1 that has…
user1579166
  • 117
  • 1
  • 2
  • 10
3
votes
1 answer

Problems with authorization after upgrading from Delphi 2005 to 2010 using Indy http (idHTTP1.Get)

I'm upgrading from Delphi 2005 to Delphi 2010. I'm having this problem : the following procedure works well on D2005 but on D2010 I got always the result : 401 Unauthorized

401 Unauthorized

Your…
Samuel
  • 55
  • 4
3
votes
1 answer

Even if SslOptions are set i keep having "Socket Error # 10054 Connection reset by peer." in Indy using TIdHTTP doing get from https url

I am using TIdHTTP to get from a https URL, my code works fine until http is used, but on https i have Socket Error # 10054 Connection reset by peer. In many SO answers I Read about TLS 1.0 being the default so I tried to set it to TLS 1.2 I…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
3
votes
3 answers

Delphi HTTP POST Method - Cookies issue

i'm trying to logging into a website but this site always response with "You don't seem to accept cookies. Cookies are required in order to log in." why my program doesn't allow cookies? function HF_Login(): boolean; var HTTP : TIDHTTP; Cookie :…
MeRo
  • 31
  • 1
  • 2
3
votes
0 answers

TIdHttp custom header on redirect

I have an issue handling redirects with a custom header. A few requests to a REST-API endpoint are acknowledged with HTTP/1.1 301 Moved Permanently. This is my code: procedure APIRequest(const url, token: string; request, response: TStream); var …
3
votes
0 answers

How to create HTTP Header for eBay Browse API Function

I am trying to get a Product Review Rating through eBay's Browse API. Here is my code for this function: sHeaders := TStringList.Create; sHeaders.Add('X-EBAY-C-ENDUSERCTX=' + '"affiliateCampaignId=' +…
James
  • 71
  • 1
  • 8
3
votes
1 answer

Delphi send HTTP GET request without wait for the server response

I want send HTTP request (GET) without wait for the server response. I have tried with IdHTTP by ignoring the response, eg.: aIdHTTP := TIdHTTP.create; try aIdHTTP.Get('https://stackoverflow.com/'); finally aIdHTTP.free; free but it always wait…
ar099968
  • 6,963
  • 12
  • 64
  • 127
3
votes
3 answers

Error 406 Not Acceptable with idHTTP on Android

I'm trying to post a insert on a MySQL database using idHTTP and a PHP script. This is the PHP script to insert in the database: $mysqli = new mysqli($servidor, $usuario, $senha, $banco); // Caso algo tenha dado errado, exibe uma mensagem…
wordermorr
  • 315
  • 1
  • 4
  • 13
1
2
3
17 18