Informatievlaanderen / VSDS-LDES-E2E-testing

End-to-end tests and tooling needed for testing LDES components build as part of VSDS
European Union Public License 1.2
5 stars 2 forks source link

Cannot bind parameter 'Headers'. Cannot convert the "Content-Type: application/ld+json" value of type "System.String" to type "System.Collections.IDictionary". #121

Closed xdxxxdx closed 1 year ago

xdxxxdx commented 1 year ago

Hello VSDS team: I am following the procedure described at: [https://github.com/Informatievlaanderen/VSDS-LDES-E2E-testing/tree/main/ldes-server-simulator] for Node.js set up. I tried to upload an LDES fragment from the (Bash) command line using curl: Step: - **curl -X POST http://localhost:8080/ldes -H "Content-Type: application/ld+json" -d "@sample.jsonld"** image

Result: I got the error:

Invoke-WebRequest : Cannot bind parameter 'Headers'. Cannot convert the "Content-Type: application/ld+json" value of
type "System.String" to type "System.Collections.IDictionary".
At line:1 char:44
+ ... ://localhost:8080/ldes -H "Content-Type: application/ld+json" -d "@sa ...
+                               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException
    + FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

image

Please help me with it Thanks

rorlic commented 1 year ago

Hi, looking at your error log I see that you run the command in a PowerShell environment.

The "curl" command in PS is not compatible with the real curl command.

Please make sure you use a bash command environment to run the curl command.