title: how i get response data from json with axios
body: <p>how i get response data and status header from json with axios?</p>
  
  <p>whats wrong with my axios code?</p>
  
  <p>my constructor:</p>
  
  <pre><code>class DetailProduct extends React.Component{
  
      constructor(){
          super();
          this.state = {
            dataOperations: [],
          isLoading: true
          };
        console.log(this.state.idf)
  
      axios.post('http://127.0.0.1:8000/barang/select/', { id: 1 })
      .then(function(response){
        console.log(response.data)
        console.log(response.status)
      });  
      }
  </code></pre>
  
  <p>my Django rest framework:</p>
  
  <pre><code>class Selectitem(GenericAPIView):
  
      permission_classes = []
  
      def post(self, request):
  
          getb = Barang.objects.filter(pk = request.POST.get('id'))
          if getb.exists():
              f = getb.first()
              return Response({'nama_barang': f.nm_barang, 'harga_satuan': f.harga_satuan}, status=status.HTTP_200_OK)
          else:
              return Response({"message": "What you were looking for isn't here."}, status=status.HTTP_400_BAD_REQUEST)
      def get_serializer_class(self):
          return SelectItem
  </code></pre>
  
  <p>i can get data if using postman</p>
  
  <p><a href="https://i.stack.imgur.com/tnRPC.png" rel="nofollow noreferrer">postman response data and status</a></p>