On RHEL5 from within both a shell (sh->bash) and a csh script curl fails with a "curl: (6) Couldn't resolve host 'application'" error.
This is the result whether run as a command at the shell and/or c-shell prompt and curl also fails with the same error when the scripts are "source'd" at the prompts (".scriptname" at sh prompt; "source scriptname" at csh prompt).
the curl command completes with the "Created" message, however, if it is copied and pasted to the shell or csh prompt. Frustrating! Looking for other reasonable things to try.
This is the curl command:
curl -i -H "Content-Type: application/json" -X POST -d @CurlData ${CurlAddr}
The "-d @CurlData" file is:
{
"A":"bbb",
"L":"mmm",
"X":"yyy",
}
The "${CurlAddr}" variable is:
http://<address>:<port>/A/B/C/post
We've googled around and tried a number of the experiments: removing the space after"Content-Type: "; adding an "Accept: ..." -H Header; having the data expressed on the command-line ( -d '{...}' ); having the address expressed on the command-line.
All combos fail with the "Can't resolve" error from scripts but complete from the prompt.
Has anyone been there before and found a solution?
Thanks.
Geo. Salisbury
Long Valley, NJ