-
-
Notifications
You must be signed in to change notification settings - Fork 213
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
StatusCode is defined as integer (string is not possible) #380
Comments
According to HTTP specification, I think it's only allowed to use a number between 100 and 599 as status code. |
Yes, in fact my use case respects this spec (the example was just to show what I need) |
Correct. The reason that you cannot use a string because it should always be an integer. So what issue do you have with this? |
In this case, is there a way to extract the status code from the url ? |
If you send something like However, at this moment, you cannot set this to the StatusCode because only integer is allowed. This could be implemented with a new cast extension on Handlebars. I can investigate this. |
BTW just posting a new mapping to the __admin is possible with a string as StatusCode: {
"Request": {
"Path": {
"Matchers": [
{
"Name": "RegexMatcher",
"Pattern": "/statuscode/(\\d+)"
}
]
},
"Methods": [
"post"
]
},
"Response": {
"StatusCode": "401",
"BodyAsJson": {
"path": "{{request.path}}"
},
"UseTransformer": true
}
} |
Actually it's the workaround I'm working with. |
@hsnsalhi |
@hsnsalhi Can you try if this version solves your issue? |
@hsnsalhi Can you please test if that version solves your problem? |
1 similar comment
@hsnsalhi Can you please test if that version solves your problem? |
@hsnsalhi Can you please test? |
Hello,
I want to extract the status code from url but the mapping json is skipped because StatusCode can't be as string.
This is an example of what I want to do:
The text was updated successfully, but these errors were encountered: