Error 415 when posting to json for api

0
import json
import requests
#criando categoria
r0_categoria_dc = {"chave": "r0_formulario", "titulo": "r0_dados_academico", "descricao": "r0_armazena_dados"}
r0_categoria_js = json.dumps(r0_categoria_dc)
print(r0_categoria_js)
r0_obj = requests.post("http://virtus.azi.com.br/virtus-rest/v1/categorias", data= r0_categoria_js)
print(r0_obj.status_code)
    
asked by anonymous 01.09.2018 / 21:35

1 answer

0

If we see what the error says 415 , we have which:

  

"Error 415 Unsupported Media Type"

Details:

  

The HTTP 415 Unsupported Media Type error of the client indicates that the server refused to accept the request because the payload format is not a supported format.

Causes:

  

The format problem because of the values indicated in the Content-Type or Content-Encoding

02.09.2018 / 02:49