개체 생성 코드가 한 줄이면 동적 json 개체를 전달할 수있었습니다. 현실 세계에서 동적 JSON 객체가 더 이상 할 필요가 있기 때문에Dynamic Json 변수를 Invoke-Restmethod로 넘김
Invoke-RestMethod -ContentType "application/json" -Method Post -Body '{ "name" : "azurefunctionapp2email", "appname": "Applicationnamehere", "requestedBy" : "requestedby", "reqdate" : "requestdate", "status" : "Successfully Deployed", "AppsCount" : "2" }' `
-Uri “https://implementurihere"
는, I는 JSON이 중단됩니다 and referenced in the above as below. But new line shift
새로운 라인을 만들어 구분. 내가 ConvertTo-Json
기능 파이프에 노력하고 유지하기 위해 출력을 발견 ''\ 연구 \ n '을 도입하기 :
$body = '{ "name" : "azurefunctionapp2email", `
"appname": "Applicationnamehere", `
"requestedBy" : "requestedby", `
"reqdate" : "requestdate",
"status" : "Successfully Deployed",
"AppsCount" : "2" }' `
Invoke-RestMethod -ContentType "application/json" -Method Post -Body $body `
-Uri “https://implementurihere"
참고 : $body
이 한 줄은 위의 작품 인 경우.
우리는 동적 json, 긴 파일 및 피드를 만드는 시나리오에서 어떻게 접근합니까?
예, 감사합니다. –