0

I just want to know whether this is the right way to post request:

$http.post(urlBase+'productattributecreate?'
    +"&products_id"="1"
    +"&attributes_id"=tab.attributeId
    +"&attributes_values_id"=tab.attributeValueId
    +"&regularPrice"=tab.regularPrice
    +"&salesPrice"=tab.salePrice
    +"&purchasePrice"=tab.purchasePrice
    +"&stockStatus"=tab.stockStatus
    +"&sttockQuantity"=tab.stockQuantity
    +"&minquantitySales"=tab.minQuantitySales
    +"&maxQuantitySales"=tab.maxQuantitySales
    +"&productImage"="")
Rick Wolff
  • 769
  • 11
  • 25
prabhat
  • 106
  • 3
  • 8

1 Answers1

0

I think a more correct way would be:

$http.post('../productattributecreate', uploadData)

Where uploadData is an object containing all you the data:

var uploadData = {
    products_id = '1',
    attributes_id = tab.attributeId,
    attributes_values_id = tab.attributeValueId,
    regularPrice = tab.regularPrice,
    salesPrice = tab.salePrice,
    purchasePrice = tab.purchasePrice,
    stockStatus = tab.stockStatus,
    sttockQuantity = tab.stockQuantity,
    minquantitySales = tab.minQuantitySales,
    maxQuantitySales = tab.maxQuantitySales,
    productImage = ''
};

Also... It would be better if you had clarified your question with more information.

Rick Wolff
  • 769
  • 11
  • 25