user3721070
user3721070

Reputation: 151

Pass empty string in Postman

I am trying to build a web API by VS.net and test it use Postman, I would like to pass an empty string through Postman, but it is a null value instead of empty string at .net side, any idea? thanks.

Postman enter image description here

.Net Web API enter image description here

Upvotes: 1

Views: 8330

Answers (1)

PDHide
PDHide

Reputation: 19989

[DisplayFormat(ConvertEmptyStringToNull = false, NullDisplayText = "empty")]

https://learn.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.displayformatattribute.convertemptystringtonull?view=net-5.0

can you try adding this :

You can also set it globally

https://stackoverflow.com/a/60749297/6793637

Upvotes: 2

Related Questions