I am trying to retrieve information about images on Dockerhub. For that I am using this curl command:
curl -X GET https://hub.docker.com/v2/repositories/library/<image-name>/tags/<image-tag>
With most images this works totally fine. However, when using an image that has a '/' in its name it does not work anymore. Is there a way I can somehow escape the '/' in the curl command? I already tried '\' but this did not work for my case.
Example for reproducing:
curl -X GET https://hub.docker.com/v2/repositories/library/curlimages/curl/tags/7.81.0
Related
I have the following API:
curl "https://api.prospect.silktide.com/api/v1/report/145b2bec22e731280103639ef580e5f4eb809942" --header "api-key: f92022fc208a3b83fe2aa85d239560f7f0a55823"
It works perfectly fine in terminal, however when I put it on my web browser as:
https://api.prospect.silktide.com/api/v1/report/145b2bec22e731280103639ef580e5f4eb809942" --header "api-key: f92022fc208a3b83fe2aa85d239560f7f0a55823"
It doesn't give any data the same way as terminal, any idea why?
Im working with an api, in the documentaion found here:
http://api.simplicate.nl/
There is an example curl:
`curl -H “Authentication-Key: {API Key}” -H “Authentication-Secret:{API secret}” https://{subdomain}.simplicate.nl/api/v2/crm/organization.json`
I ran that code like this in terminal:
curl -H “Authentication-Key:XX” -H “Authentication-Secret:XX” https://mydomain.simplicate.nl/api/v2/crm/organization.json
It runs but returns nothing.
You are using Header inside “...” that is wrong. You have to use double quote "..." (not sure what it is called, standard double quote?).
So it should be:
curl -H "Authentication-Key:XX" -H "Authentication-Secret:XX" https://mydomain.simplicate.nl/api/v2/crm/organization.json
As a note, currently your curl is sending the headers as following with extra characters.
“Authentication-Key:XX”
“Authentication-Secret:XX”
But it should be:
Authentication-Key:XX
Authentication-Secret:XX
i'm trying to connect ti a web api service, box-api, and following the tutorial i have to type this command to fetch a folder in the user content:
curl https://api.box.com/2.0/folders/FOLDER_ID/items?limit=2&offset=0 -H "Authorization: Bearer ACCESS_TOKEN"
I tryied to connect from the command line to test the command but it keep complaining about the -H or the --header command saying that it doesn exist:
-bash: -H: command not found
-bash: --header: command not found
but when i type curl --help the command is in the manual:
-H, --header LINE Custom header to pass to server (H)
I'm confused, what should i do to connect to this site and get the JSON content? Thanks
Your url has & sign. and this is making end of command on there(and running at background). You can remove this error by using quotes around. Like this
curl "https://api.box.com/2.0/folders/FOLDER_ID/items?limit=2&offset=0" -H "Authorization: Bearer ACCESS_TOKEN"
Hope this helps.
There seem to be two problems:
The '&' in the middle of the URL passed to curl,
The order of the statements. The curl manual reports a different order for the statements. Example:
curl -H "Authorization: Bearer AUTH_KEY" "https://api.box.com/2.0/folders/0/items?limit=2&offset=0"
This should be the complete solution.
I am trying to receive json from a server which is using curl.
The problem is that the &method=somecall will be truncated somehow.
In apple teminal the call is working with '..' around the url, but I can't make it work in Xcode. It results in an invalid url.
Someone mentioned the curl parameter -d to add a method to a call. Is there a way to do it in Objective C?
This url is not working, neither in browser nor in code:
http://username:password#someURL/index_api.php?type=json&method=someMethod&id=1
OSX Terminal:
curl -u username:password 'http://someURL/index_api.php?type=json&method=someMethod&id=1'
is working only with the '..'
curl -G -u username:password 'http://someURL/index_api.php?type=json&method=someMethod&id=1' -d "type=json" -d "method=omeMethod" -d "id=1"
is also working on terminal.
I was now able to get a response using BBHTTP an objective c wrapper for libCurl.
I'm trying to use http PUT via cURL to update my triple store in openrdf-sesame, but I've hit a problem that I can't find a solution for.
When using POST, the triple data uploads perfectly.
But then using PUT, instead of adding the data provided, it deletes all the data from my repository. I've ran cURL in verbose mode, and it's giving back the expected HTTP status code.
I've added
<init-param>
<param-name>readonly</param-name>
<param-value>false</param-value>
</init-param>
to Apache Tomcat's web.xml,
Ive also tried the guide here: HTTP PUT Guide, but that hasn't helped either.
EDIT
Here are the cURL commands from my batch file:
call "%curl%" -# -X POST %endpoint%/statements -H "Content-Type:application/x-trig;charset=UTF-8" -d #%%X
call "%curl%" -# -X PUT %endpoint%/statements -H "Content-Type:application/x-trig;charset=UTF-8" -d #%%X
Which is essentially:
curl.exe -# -X POST http://myendpoint/statements -H "Content-Type:application/x-trig;charset=UTF-8" -d #MyTrigFile.trig
curl.exe -# -X PUT http://myendpoint/statements -H "Content-Type:application/x-trig;charset=UTF-8" -d #MyTrigFile.trig
For the moment, I've disabled authentication, but otherwise I'd also include a -u user:password argument.
I have just ran some tests using your exact way of invoking curl, and I can't reproduce the problem (using Sesame version 2.6.8): it works as expected here.
The only possible cause I can think of is that your TriG file has a syntax error which Sesame fails to report back.
Another possible problem is your expectations: the command as you execute it will completely clear the entire repository and replace the data with the contents of your TriG file. Were you perhaps expecting something else?
To further debug this, can you have a look in the Sesame server logs and tell us if it shows any warnings or errors? Server logs are viewable by going to http://<server:port>/openrdf-sesame/ in the browser and clicking 'System' in the menu on the left.