0

I have the following curl:

curl -X 'GET' 'http://some/some/sample' -H 'accept: application/json' -H 'authorization: admin'

From which I get 2 different results from an apache pod(I need it to work here, but it doesn't) and Swagger UI(which give the right output). The one on the right is what I should receive, this is just one example, I need to do this CURL that automatically escapes characters like Swagger UI does, any help would be much appreciated, thank you.

The differences are below:left is mine which should work, right is Swagger UI which works

Differences

And I want to use the above output to do the following:

curl -X 'POST' \
  'http://some/some' \
  -H 'accept: application/json' \
  -H 'authorization: admin' \
  -H 'Content-Type: application/json' \
  -d '{
  "components": [
    {
      "locator": "sample1",
      "config": "output from the above GET curl" (it is an xml file)
    }
  ]
}'
  • It seems like you want to escape the output of the `curl` command; so, what's important to know is in which context will the escaped string be used. – Fravadona Feb 14 '23 at 11:25
  • @Fravadona I updated the question about where do I want to use the output of that curl. – cojocaru robert Feb 14 '23 at 12:04
  • If I am not mistaken, if the xml is left in the external xml file, there is no need for the requested form of output. You only need that if you want to insert the content of the xml file into your above POST statement, because it is being interpreted by the shell before the curl command gets to it. – Eric Marceau Feb 14 '23 at 21:24

0 Answers0