I have a requirement to implement regular expression that accepts space in double quotes for email address. example, "unusual email with space"@domain.com. Please note the email is double quoted and is valid email.
I am testing my api with Postman and below is my request body:
{"data":
{ "id": "#customerId",
"type": "customer s",
"attributes": {
"contactInformation" : {
"emailAddresses" :
[
{
"emailAddress" : "\"unusual email with space\"@domain.com"
}
]
}
}
}
}
The request goes through and comes to my api controller but the space is replaced by new line (\n).
"\"unusual email with\nspace\"@domain.com"
My request header contains :
Content-Type: application/json Accept-Charset: UTF-8
Can someone please help how to get the exact same string with space?
Regards, Mahendra Rathod
答案 0 :(得分:0)
如果用\ u0020或%20替换空格应该没问题。!