AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi DELETE-Methode fuer HTTP gesucht und selbst gebastelt
Thema durchsuchen
Ansicht
Themen-Optionen

DELETE-Methode fuer HTTP gesucht und selbst gebastelt

Ein Thema von mashutu · begonnen am 7. Aug 2008 · letzter Beitrag vom 7. Aug 2008
Antwort Antwort
mashutu

Registriert seit: 15. Nov 2007
195 Beiträge
 
#1

DELETE-Methode fuer HTTP gesucht und selbst gebastelt

  Alt 7. Aug 2008, 09:08
Servus ich versuche mein GPS-Mapper mit den Daten von Openstreetmap zu verbinden, was grundsaetzlich auch geht.
Bislang verwende ich Delphi 2006 mit Indy 10.1 und zwar die TidHTTP-Component.

PUT und GET funktionieren auch. Aber TIDHTTP hat keine DELETE-Methode.

Delphi-Quellcode:
Ausschnitt aus den Protocol-Specs
----------------------cut--------------------
   Basic Methods for Object Access and Manipulation

For each of the above-mentioned object types, the API supports these CRUD operations (replace <objtype> by one of node, way, relation; replace <id> by the id of the object in question):

.....................................................Payload
Purpose_________HTTP Method and URL_______________Request_______Response
Creation________PUT /api/0.5/<objtype>/create____XML per DTD___id
Retrieval_______GET /api/0.5/<objtype>/<id>______n/a___________XML per DTD
Update__________PUT /api/0.5/<objtype>/<id>______XML per DTD___empty
Deletion________DELETE /api/0.5/<objtype>/<id>______n/a___________n/a
----------------------cut---------------------
Ich habe es wie folgt mit der Property Request versucht, was aber nicht funktioniert:
Delphi-Quellcode:
var
   httpLink : TIdHTTP;
begin
    sURL := 'http://api.openstreetmap.org/api/0.5/node/'+intToStr(nodeid),
    httpLink.Request.Method:=Id_HTTPMethodDelete;
    try
       iRes := -1;
       sResult := httpLink.Put(sURL,xStream);

    ...
end;
Jemand eine Idee wie man DELETE operationen realisieren kann?
Danke fuer Eure Muehe



utu
utu

if it was hard to write it should be hard to read
  Mit Zitat antworten Zitat
mkinzler
(Moderator)

Registriert seit: 9. Dez 2005
Ort: Heilbronn
39.851 Beiträge
 
Delphi 11 Alexandria
 
#2

Re: DELETE-Methode fuer HTTP gesucht

  Alt 7. Aug 2008, 09:21
Vielleicht mit Synapse oder ICS
Markus Kinzler
  Mit Zitat antworten Zitat
mashutu

Registriert seit: 15. Nov 2007
195 Beiträge
 
#3

Re: DELETE-Methode fuer HTTP gesucht

  Alt 7. Aug 2008, 09:40
Zitat von mkinzler:
Vielleicht mit Synapse oder ICS
Danke werde es mir anschauen.
utu

if it was hard to write it should be hard to read
  Mit Zitat antworten Zitat
mashutu

Registriert seit: 15. Nov 2007
195 Beiträge
 
#4

Re: DELETE-Methode fuer HTTP gesucht

  Alt 7. Aug 2008, 09:53
Auf den ersten Blick bietet weder ICS noch Synapse eine DELETE-Methode ... muss mal noch weiter graben.
utu

if it was hard to write it should be hard to read
  Mit Zitat antworten Zitat
mashutu

Registriert seit: 15. Nov 2007
195 Beiträge
 
#5

Re: DELETE-Methode fuer HTTP gesucht und selbst gebastelt

  Alt 7. Aug 2008, 20:43
Okay, da ich auf die Schnelle keine Komponente gefunden habe, die ein DELETE implementiert, habe ich mir das selbst geschrieben:
Delphi-Quellcode:
unit yIdHttpExt;//my IdHTTPExtension

interface
uses
    IdHTTP;
type
    yIdHTTP = class(TIdHTTP)
        private
        published
        public
            procedure delete(AURL: string);
    end;
implementation

procedure yIdHTTP.delete(AURL: string);
begin
  DoRequest(Id_HTTPMethodDelete, AURL, nil, NIL, []);
end;

end.
Sollte selbsterklaerend sein. DoRequest ist in der Basisklasse (TIdCustomHTTP) als [protected] deklariert ...
Erste Tests sehen vielversprechend aus.
[Edit:
ProtocolVersion := pv1_1;
required]
utu

if it was hard to write it should be hard to read
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 09:25 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz