function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
levaleva 

Jersey lib @HttpPost trying to pass Map<String, String[]>

Hi,

 

I am trying to make a post call to rest service in SalesFroce using jersey library.  I want to post a JSON "HashMap" to SF. I want the structure to look something like this:

 

{
    "Id1": ["email1", "email2" ... "emailX"]
    "Id2": ["email1", "email2" ... "emailX"] 
...
}

 

 

 

I have a custom rest service, @HttpPost method has this signiture

 

@HttpPost
global static void doPost(Map<String, String[]> args)

 on the Java end I have:

MultivaluedMap<String, String> params = new MultivaluedMapImpl();

 

Am I taking a right aproach? What need to happen with MultivaluedMap, it only accepts <String, String> type parameters? If any knows any coding examples integrating jesey, salesforce REST API that would really help

 

Thank you, in advance for taking the time!