In a gRPC request, Does Postman support auto-converting date strings to a timestamp? If I enter “2024-03-03T00:13:01.000000761Z” for the timestamp field, will postman convert it to a timestamp value like “1709424781”.
If conversion is not automatic, how change I change the request Message using a Pre-request script. I tried this to see if I could change the message: pm.request.messages.upsert(‘data:start_date’, { “seconds”:“1709412122”, “nanos”:“0” }); but it has no effect.
I could use variables for the request message, except they do not appear to be supported for gRPC.
I get “errors in your composed message” and a log dump of the request.messages shows an unresolved {{…}}.
Having the startdate and enddate directly in the message on the call would be best, as I will end up with a large number of calls to test. I could then open a request, type in the date(s) into the message in human readable format and have a script automatically convert it to the google.protobuf.Timestamp.
@michaelderekjones Thank you for being part of the community and sharing the workaround!
@material-engineer-19 We are sorry that you are facing this difficulty. Let me assure you we consistently listen to our community’s feedback and strive to improve our product.
Now to clarify a few of things here:
gRPC request messages do support variables. Looking at the screenshot shared above, you’ll need to wrap the variable in quotes to make it a valid JSON.
As rightly mentioned, request mutation is not supported in gRPC, but we are already tracking it internally, and you can follow this thread for further updates.
We’ll evaluate having first-class support for interacting with google.protobuf.Timestamp#11273
Please open an issue on our tracker for any other specific bugs/feedback you want us to look at.
Thank you for the reply and especially pointing out my error with the message variables. I will follow those other threads. The timestamp auto-conversion would make Postman much more usable for Grpc. My team is currently using Kreya (it offers the auto-conversion), but I find it cumbersome to use. We have many endpoints using date filters. If I can get the date conversion stuff sorted out (even if using another endpoint to convert the date and update the variable), that will get me closer to convincing the team to move to Postman.