![]()  | 
  
Chilkat  HOME  Android™  AutoIt  C  C#  C++  Chilkat2-Python  CkPython  Classic ASP  DataFlex  Delphi DLL  Go  Java  Node.js  Objective-C  PHP Extension  Perl  PowerBuilder  PowerShell  PureBasic  Ruby  SQL Server  Swift  Tcl  Unicode C  Unicode C++  VB.NET  VBScript  Visual Basic 6.0  Visual FoxPro  Xojo Plugin
 
      (Lianja) Shopware Delete MediaSee more Shopware ExamplesDemonstrates how to delete a media file from a Shopware shop.Note: This example requires Chilkat v11.0.0 or greater. 
 llSuccess = .F. // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. loHttp = createobject("CkHttp") loHttp.Login = "api_username" loHttp.Password = "api_key" loHttp.BasicAuth = .T. // The id of the product is appended to the path part of the URL. loHttp.SetUrlVar("id","6864") lcUrl = "https://my-shopware-shop.com/api/media/{$id}" // Send a DELETE request with nothing in the request body. loResp = createobject("CkHttpResponse") llSuccess = loHttp.HttpNoBody("DELETE",lcUrl,loResp) if (llSuccess = .F.) then ? loHttp.LastErrorText release loHttp release loResp return endif loSbResponseBody = createobject("CkStringBuilder") loResp.GetBodySb(loSbResponseBody) loJResp = createobject("CkJsonObject") loJResp.LoadSb(loSbResponseBody) loJResp.EmitCompact = .F. ? "Response Body:" ? loJResp.Emit() // A 200 response code indicates success (i.e. the request was sent and a response was received). lnRespStatusCode = loResp.StatusCode ? "Response Status Code = " + str(lnRespStatusCode) if (lnRespStatusCode >= 400) then ? "Response Header:" ? loResp.Header ? "Failed." release loHttp release loResp release loSbResponseBody release loJResp return endif // Sample JSON response: // { // "success": true // } llBDeleted = loJResp.BoolOf("success") ? "Deleted: " + str(llBDeleted) // A failed response would look like this: // { // "success": false, // "message": "Product by \"id\" 6864 not found" // } release loHttp release loResp release loSbResponseBody release loJResp  | 
  ||||
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.