[lxc-devel] [lxd/master] Fixed errors on api examples with curl

elvsp1n on Github lxc-bot at linuxcontainers.org
Wed Jul 20 15:03:34 UTC 2016


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 767 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20160720/618269c9/attachment.bin>
-------------- next part --------------
From 09eef6e1a4f15fa439bb3795a4718fc01ec2a8bc Mon Sep 17 00:00:00 2001
From: Elvis Espinal <elvisespinal at neoscloudllc.com>
Date: Wed, 20 Jul 2016 11:02:47 -0400
Subject: [PATCH] Fixed errors on api examples with curl

Testing the 1st example "talking over the socket", I got this error: curl: (35) gnutls_handshake() failed: An unexpected TLS packet was received. Because the url is pointing to the TCP and not the socket.
Testing the 2nd example "talking over TCP", I got these warnings:
      1-Warning: You can only select one HTTP request method! You asked for both POST
      2-Warning: (-d, --data) and HEAD (-I, --head).
With these changes both examples run without errors.
---
 README.md | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/README.md b/README.md
index 56599bf..54ad4a2 100644
--- a/README.md
+++ b/README.md
@@ -37,7 +37,7 @@ curl --unix-socket /var/lib/lxd/unix.socket \
     -H "Content-Type: application/json" \
     -X POST \
     -d @hello-ubuntu.json \
-    "https://127.0.0.1:8443/1.0/containers"
+    lxd/1.0/containers
 ```
 
 #### via TCP
@@ -46,7 +46,7 @@ TCP requires some additional configuration and is not enabled by default.
 lxc config set core.https_address "[::]:8443"
 ```
 ```bash
-curl -k -L -I \
+curl -k -L \
     --cert ~/.config/lxc/client.crt \
     --key ~/.config/lxc/client.key \
     -H "Content-Type: application/json" \


More information about the lxc-devel mailing list