curl

How can I log in to Stack Exchange using curl?

送分小仙女□ 提交于 2021-02-07 23:52:19
问题 I would like to log in to a remote website from Terminal, which requires an username and password to log in. So I first tried to log in to one of the Stack Exchange site. According to this answer, you use -u username:password to add your credentials. So I tried the following: USERNAME="mine@gmail.com" PASSWORD="myPassword" URL="https://sustainability.stackexchange.com/" curl $URL -u $USERNAME:$PASSWORD But the resultant website is not a page that the logged-in user sees but it is a page that

PHP: Keep HTTPS Connection to API open throughout multiple requests

徘徊边缘 提交于 2021-02-07 21:49:20
问题 I'm writing a plugin for wordpress that needs to call an API for every request the user makes. These API-calls are done using the HTTPS protocol. Currently, for every new user request, I need to reopen the HTTPS connection. Yes, curl allows persistent connections (reusing the handle or using the multi handle) but I would like to persist the connection throughout multiple user requests. So: Is it possible to keep a HTTPS connection open throught multiple PHP processes and reuse it? The

PHP: Keep HTTPS Connection to API open throughout multiple requests

与世无争的帅哥 提交于 2021-02-07 21:49:04
问题 I'm writing a plugin for wordpress that needs to call an API for every request the user makes. These API-calls are done using the HTTPS protocol. Currently, for every new user request, I need to reopen the HTTPS connection. Yes, curl allows persistent connections (reusing the handle or using the multi handle) but I would like to persist the connection throughout multiple user requests. So: Is it possible to keep a HTTPS connection open throught multiple PHP processes and reuse it? The

Cloud9 Rails API challenge: allowed network but still cannot render console

最后都变了- 提交于 2021-02-07 20:27:30
问题 I am following along with this Treehouse Build a Rails API course. I am using Cloud9 IDE which I think is related to the problem. The step I am stuck on is creating a new list via the API in the console. At first I was receiving an error message saying "cannot render console" from the network. After googling this, I whitelisted the network in the development.rb file. The error message is different and so I believe I properly whitelisted it (or at least did something). But it does not have the

Cloud9 Rails API challenge: allowed network but still cannot render console

限于喜欢 提交于 2021-02-07 20:26:26
问题 I am following along with this Treehouse Build a Rails API course. I am using Cloud9 IDE which I think is related to the problem. The step I am stuck on is creating a new list via the API in the console. At first I was receiving an error message saying "cannot render console" from the network. After googling this, I whitelisted the network in the development.rb file. The error message is different and so I believe I properly whitelisted it (or at least did something). But it does not have the

PHP Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 2: easy handle already used in multi handle

懵懂的女人 提交于 2021-02-07 17:03:54
问题 I am a user not a developer. The developer is not available. This is the Google API library used in Google Shopping Products submission scripts. The scripts worked successfully, every 20 minutes, for 2 years + the first 5 hours of yesterday. Then the following error: [18-Apr-2020 06:20:03 Europe/London] PHP Fatal error: Uncaught GuzzleHttp\Exception\RequestException: cURL error 2: easy handle already used in multi handle (see https://curl.haxx.se/libcurl/c/libcurl-errors.html) in ../vendor

API call using Ansible uri module

风流意气都作罢 提交于 2021-02-07 14:55:23
问题 I am trying to use the Ansible uri module to communicate with DeployHQ's API. Here is the example DeployHQ's documentation that I am trying to use from Ansible: curl -H "Content-type: application/json" \ -H "Accept: application/json" \ --user adam@atechmedia.com:my-api-key \ -d '{"deployment":{ "parent_identifier":"7563d091-ca73-588e-cfe2- e4936f190145", \ "start_revision" : "e84b5937f1132932dd56026db26a76f406555c19", \ "end_revision" : "e84b5937f1132932dd56026db26a76f406555c19", \ "mode" :

Keycloak: Validate access token and get keycloak ID

核能气质少年 提交于 2021-02-07 13:44:41
问题 I need to be able to do the following (with plain cURL & JSON server-side- no frameworks or Java): Use a string representation of a Keycloak access token I have been given by a 3rd party to verify that the token is valid. If the token is valid, get the Keycloak ID for that user. How do I do this using plain old HTTP posts? I've found lots of Java examples but I need to know the raw HTTP POSTs and responses underneath. Is it something like this to validate the token? /auth/realms/<realm>

Keycloak: Validate access token and get keycloak ID

纵饮孤独 提交于 2021-02-07 13:43:33
问题 I need to be able to do the following (with plain cURL & JSON server-side- no frameworks or Java): Use a string representation of a Keycloak access token I have been given by a 3rd party to verify that the token is valid. If the token is valid, get the Keycloak ID for that user. How do I do this using plain old HTTP posts? I've found lots of Java examples but I need to know the raw HTTP POSTs and responses underneath. Is it something like this to validate the token? /auth/realms/<realm>

CURLINFO_SSL_ENGINES don't list openssl engine

和自甴很熟 提交于 2021-02-07 10:43:38
问题 I try to use engine pkcs11 with curl. Firstly, I add my engine pkcs11 to openssl. int initEngine() { ENGINE_load_builtin_engines(); ENGINE *e; display_engine_list(); e = ENGINE_by_id("dynamic"); if(!e) { return -1; } if(!ENGINE_ctrl_cmd_string(e, "SO_PATH", ENGINE_SO_PATH, 0)) { return -2; } if(!ENGINE_ctrl_cmd_string(e, "ID", "pkcs11", 0)) { return -3; } if(!ENGINE_ctrl_cmd_string(e, "LIST_ADD", "1", 0)) { return -4; } if(!ENGINE_ctrl_cmd_string(e, "LOAD", NULL, 1)) { return -5; } if(!ENGINE