mitodl / ccxcon

CCXCon API
GNU Affero General Public License v3.0
7 stars 0 forks source link

The request to EDX to create a CCX should contain a JSON encoded payload #134

Closed giocalitri closed 8 years ago

giocalitri commented 8 years ago

Bug found while writing the script to create CCX using CCXCon.

This is as easy as changing the request in views.py -> create_ccx from

   try:
        resp = requests.post(
            '{instance}/api/ccx/v0/ccx/'.format(instance=course.edx_instance.instance_url),
            data=payload,
            headers={
                'Authorization': 'Bearer {}'.format(access_token),
            })

to

    try:
        resp = requests.post(
            '{instance}/api/ccx/v0/ccx/'.format(instance=course.edx_instance.instance_url),
            json=payload,
            headers={
                'Authorization': 'Bearer {}'.format(access_token),
            })

and update tests