AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi REST Problem (Alles geht nur Delphi nicht)
Thema durchsuchen
Ansicht
Themen-Optionen

REST Problem (Alles geht nur Delphi nicht)

Ein Thema von t2000 · begonnen am 10. Jan 2022 · letzter Beitrag vom 11. Jan 2022
 
Rollo62

Registriert seit: 15. Mär 2007
4.164 Beiträge
 
Delphi 12 Athens
 
#20

AW: REST Problem (Alles geht nur Delphi nicht)

  Alt 11. Jan 2022, 17:34
Und was ist die Moral von der Geschicht' ?

Statt
Delphi-Quellcode:
  RESTClient1.BaseURL := 'https://api.pay1.de/post-gateway/';
  ...

besser die BaseURL und Resource schön separat angeben, so wie es eigentlich gedacht ist.

Delphi-Quellcode:
  RESTClient1.BaseURL := 'https://api.pay1.de';
  RESTRequest1.Resource := 'post-gateway/';       // der Slash ist hier seitens Pay1 notwendig!
  ...
! Und auf Slashes achten ...

Im DocWiki steht dazu Folgendes:

TRESTClient.BaseURL:
https://docwiki.embarcadero.com/Libr...Client.BaseURL
Zitat:
Specifies the base URL for all API calls.

All resources and parameters of your requests will be appended to this URL.
You can add a trailing forward slash to the value of the BaseURL property when resources are empty,
this offers support for web services that expect the trailing slash.
==> OK, das macht Sinn, ... Einer für ALLE ...

TRESTRequest.Resource:
https://docwiki.embarcadero.com/Libr...quest.Resource
Zitat:
This property is added to the base URL to establish a complete URL for the HTTP request.
Important: The Resource value should meet the following limitations:
- Does not include the scheme or domain mame.
- Does not include the leading slash.
==> OK, hier fehlt dann der Hinweis auf "trailing slash"

Deshalb finde ich ein gutes Beispiel besser als tausend Worte
  Mit Zitat antworten Zitat
 


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 07:17 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz