Sample code for 30+ languages & platforms
Zig

Akeneo: Delete Product

See more HTTP Misc Examples

Demonstrates how to delete product.

Chilkat Zig Downloads

Zig
const std = @import("std");
const chilkat = @import("chilkat");

pub fn main(init: std.process.Init) !void {
    const alloc = init.arena.allocator();

    // This example requires the Chilkat API to have been previously unlocked.
    // See Global Unlock Sample for sample code.

    const http = try chilkat.Http.init();
    defer http.deinit();

    // Use your previously obtained access token.
    // See Get Akeneo Access Token
    http.setAuthToken("access_token");

    http.setUrlVar("productCode", "123") catch {};

    const resp_str = http.quickDeleteStr(alloc, "http://pim.my-akeneo-site.com/api/rest/v1/products/{$productCode}") catch {
        std.debug.print("{s}\n", .{try http.getLastHeader(alloc)});
        std.debug.print("{s}\n", .{try http.getLastErrorText(alloc)});
        return;
    };

    std.debug.print("Response Status Code: {d}\n", .{http.getLastStatus()});
    std.debug.print("Response Body: {s}\n", .{resp_str});
}