... until the collector arrives ...

This "blog" is really just a scratchpad of mine. There is not much of general interest here. Most of the content is scribbled down "live" as I discover things I want to remember. I rarely go back to correct mistakes in older entries. You have been warned :)


curl vs. Windows vs. esi.manage measure export

A self-contained Windows command file can use curl to invoke the esi.manage measure export integration service through judicious use of newline and quote escaping:



SET server=

SET request=^
  -h ^
  -c none        -m PRODUCTION -b GROSS -v FORECAST -U Oil:boe -D NONE        --curtailment ^
  -c scheduled   -m PRODUCTION -b GROSS -v FORECAST -U Oil:boe -D SCHEDULED   --curtailment ^
  -c unscheduled -m PRODUCTION -b GROSS -v FORECAST -U Oil:boe -D UNSCHEDULED --curtailment ^
  -c all         -m PRODUCTION -b GROSS -v FORECAST -U Oil:boe -D ALL         --curtailment ^
 2010-01-01 ^
 18 M ^
 \"origin subset\"

curl ^
  --ntlm ^
  --user : ^
  -X POST ^
  -H "content-type:text/plain" ^
  --data-binary "%request%" ^

The use of the --data-binary option is important since -d or --data-ascii will reformat the data (e.g. strip newlines).

Blog Archive