Skip to content
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

Error 500 on HTTP POST #92

Closed
andrea-dintino opened this issue Feb 9, 2022 · 3 comments
Closed

Error 500 on HTTP POST #92

andrea-dintino opened this issue Feb 9, 2022 · 3 comments
Assignees

Comments

@andrea-dintino
Copy link
Member

This script:

Rule caller restroom-mw

Given I have a 'string' named 'add-identity'
Given I have a 'string dictionary' named 'identity'
Given I have a 'string dictionary' named 'output'

Given I connect to 'add-identity' and pass it the content of 'identity' and save the output into 'output'

Then print data

with this data:

{
	"add-identity": "https://apiroom.net/api/dyneorg/consensusroom-add-identity",
	"identity": {
		"Kenshiro": {
			"baseUrl": "http://192.168.0.100:3030",
			"ip": "192.168.0.100",
			"public_key": "BGiQeHz55rNc/k/iy7wLzR1jNcq/MOy8IyS6NBZ0kY3Z4sExlyFXcILcdmWDJZp8FyrILOC6eukLkRNt7Q5tzWU=",
			"timeServer": "http://localhost:3312",
			"uid": "Kenshiro",
			"version": "1"
		}
	}
}

produces an error 500. The API is hosted at: https://apiroom.net/api/dyneorg/consensusroom-announce-p2


You can test the endpoint to which the POST is targeted using:

curl -X 'POST' \
  'https://apiroom.net/api/dyneorg/consensusroom-add-identity' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "data": {

"identity": {
		"Kenshiro": {
			"baseUrl": "http://192.168.0.100:3030",
			"ip": "192.168.0.100",
			"public_key": "BGiQeHz55rNc/k/iy7wLzR1jNcq/MOy8IyS6NBZ0kY3Z4sExlyFXcILcdmWDJZp8FyrILOC6eukLkRNt7Q5tzWU=",
			"timeServer": "http://localhost:3312",
			"uid": "Kenshiro",
			"version": "1"
		}
	}



},
  "keys": {}
}'
@puria
Copy link
Member

puria commented Feb 9, 2022

yes you are sending the identity not wrapped into data field that is demanded by the restroom api... can you double check with:

Rule caller restroom-mw

Given I have a 'string' named 'add-identity'
Given I have a 'string dictionary' named 'identity'
Given I have a 'string dictionary' named 'output'

Given I connect to 'add-identity' and pass it the content of 'data' and save the output into 'output'

Then print data

with the following:

{
	"add-identity": "https://apiroom.net/api/dyneorg/consensusroom-add-identity",
	"data": { "identity": {
		"Kenshiro": {
			"baseUrl": "http://192.168.0.100:3030",
			"ip": "192.168.0.100",
			"public_key": "BGiQeHz55rNc/k/iy7wLzR1jNcq/MOy8IyS6NBZ0kY3Z4sExlyFXcILcdmWDJZp8FyrILOC6eukLkRNt7Q5tzWU=",
			"timeServer": "http://localhost:3312",
			"uid": "Kenshiro",
			"version": "1"
		}
}
	}
}

@andrea-dintino
Copy link
Member Author

I was wrapping it right, just tried, I get the same error 500

@puria puria closed this as completed in b4c9c3a Feb 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants