New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The generated powershell script executed and lost content of some properties #6775
Comments
@chucklu We are unable to comment on behavior of individual endpoints. Can you send a POST request to |
What did you mean by "behavior of individual endpoints"? I tried send a post request as following $response = Invoke-RestMethod 'https://postman-echo.com/post' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json and the response is
What's the relationship with the problem I encountered and the new test for https://postman-echo.com/post? |
@chucklu We can only investigate discrepancy in sending the request. https://postman-echo.com/post will return whatever you send in the request. It should return all URL parameters, request headers/body parameters that you send. We'll be unable to investigate why the behavior of |
@abhijitkane I remove the
And the response is as following:
The logisticsRecord property was an object array. Then I tried to inspect the request by fiddler, it seems the response was correct. But the response did not get parsed correctly by Powershell. There is no problem with the Powershell code generated by Postman,I will submit an issue in Powershell project later. |
@abhijitkane Finally I found the problem could be resolved by the depth parameter of ConvertTo-Json. I have a suggestion, you might just return $response, and let the user to convert the json with the desired depth. $headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Accept", 'text/html')
$headers.Add("Content-Type", 'application/x-www-form-urlencoded')
$body = "billCode=75132077503374"
$response = Invoke-RestMethod 'https://hdgateway.zto.com/WayBill_GetDetail' -Method 'POST' -Headers $headers -Body $body
$response and then execute it with the specific depth .\postman.ps1 | ConvertTo-Json -Depth 5 |
Also find another stackoverflow summary |
Closing this issue due to inactivity. |
Describe the bug
The following generated powershell script executed,and lost content for logisticsRecord property
Result
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Get the full information like http post
Screenshots
The full information get from http post directly
App information (please complete the following information):
The text was updated successfully, but these errors were encountered: