Einzelnen Beitrag anzeigen

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