I can not make a post request with these parameters:
Site: http://www.zoover.it
This is my code:
import requests
Request_URL="http://www.zoover.it/services/Testimonials/TestimonialQueryService.asmx/AccommodationTestimonialQuery"
serviceRequest:{"CurrentLanguage":"Language_NL","PartyFilter":"","CurrentPage":"0","PageSize":"10","SortOption":"date-of-visit"}
pageContext:{"EntityLevel":"accommodation","NewEntityLevel":"accommodation","EntityId":151433,"EntityName":"Residence Belmonte Vacanze****","SemanticName":"accommodation-testimonials","PhysicalUrl":"/accommodation/testimonials.aspx","CurrentSiteVariation":"it","CmsAccommodationTypeFilter":"","PageCode":"accommodation","PageSubcode":"testimonials","CmsEntity":{"Level":1,"Id":151433},"NewCmsEntity":{"Level":{"EntityLevel":"accommodation"},"Id":151433},"Path":"/accommodation/testimonials.aspx","PageSemantic":{"SemanticName":"accommodation-testimonials","PhysicalUrl":"/accommodation/testimonials.aspx","KnownFriendlyParams":["accommodationId"],"HasFriendlyUrl":true},"EntityType":"Appartamento","PageRequestUrl":"/italia/toscana/montaione/residence-belmonte-vacanze/appartamento"}
r = requests.post(Request_URL, params=serviceRequest)
print r.text
I have two problems:
1) in R.TEXT I always get “HTTP Error 411. The request must be chunked or have a content length.”
2) I don’t know how to do POST with two dictionaries (serviceRequest and pageContext)
My goal is to make web scraping by changing the parameters of the dictionary.
Thanks for your help
Use the
datakeyword instead and the content length will be set automatically:You’ll have to combine the two dictionaries into one: