Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Make a get request with a multiple value param in django requests Module?

I have a webservice that give doc list. I call this webservice via get_doc_list.
but when I pass 2 values to id__in, it return one mapping object.

def get_doc_list(self, id__in):
        config = self.configurer.doc
        params = {
            "id__in": id__in,
        }
        response = self._make_request(
            token=self.access_token,
            method='get',
            proxies=self.proxies,
            url=config.service_url,
            params=params,
            module_name=self.module_name,
            finalize_response=False
        )
        return response

How can I fix it?!

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You can add this two lines before make_request:

string_id_in = [str(i) for i in id_in]
id_in = ",".join(string_id_in)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading