sending verification data in get request

i want to send a get request to an endpoint ( https://zccore.herokuapp.com/data/read )but i am expected to send along some verification data in other to get what i want, they are ( the plugin_id, collection_name/organization_id) and it should be in this format

https://zccore.herokuapp.com/data/read/{plugin_id}/{collection_name}/{organization_id}
pls who do i write my view to do this

Are you looking to actually do the get from within the view, or are you looking to pass this url out to the client’s browser for it to be used in a JavaScript AJAX-type call?

If you’re wanting to do this in the server in the view, I would suggest using the requests module. It really has been the easiest way for us to make http requests from within Python.

(Strictly speaking, this is not a Django issue. The mechanics for making this request and handling the responses would be the same regardless of whether you’re doing this in a stand-alone Python script, using Flask, Bottle, or pretty much any framework. The only potential difference is what you do with the response after it has been received.)

not django yes, here’s a quick example which hopefully helps you go in the right direction?

import requests

r = requests.get(
  'https://zccore.herokuapp.com/data/read/{plugin_id}/{collection_name}/{organization_id}'
)

print(r.status_code)
print(r.json()) # assuming the response is returned as a valid JSON string..

… and older way:

r = requests.get(
  'https://zccore.herokuapp.com/data/read/%s/%s/%s' % (
    plugin_id,
    collection_name.
    organization_id
  )
)

print(r.status_code)
print(r.json()) # assuming the response is returned as a valid JSON string..