2017-01-24 11 views
-1

私はこのサイトにいますhttps://www.oneness287.com/collections/all/products/adidas-equipment-support-adv-4この商品をショッピングカートに追加したいと考えています。フォームアクションは=「/カート/追加」ので、私は動作するはずだと思う何golangを使用してカートに商品を追加する(ポストフォーム)

は(X =サイトのURL)

resp,err := http.PostForm(x+"/cart/add",url.Values{"id":{"29709681417"}}) 

で、サイズの入力タイプは、名前IDを持っています。

が、この後のレスポンスボディは
&{404 Not Found 404 HTTP/1.1 1 1 map[Date:[Tue, 24 Jan 2017 10:15:39 GMT] X-Dc:[ash,chi2] Content-Type:[text/html; charset=utf-8] Vary:[Accept-Encoding] X-Shardid:[8] X-Permitted-Cross-Domain-Policies:[none] X-Xss-Protection:[1; mode=block; report=/xss-report?source%5Baction%5D=not_found&source%5Bapp%5D=Shopify&source%5Bcontroller%5D=storefront_section%2Fshop&source%5Bsection%5D=storefront&source%5Buuid%5D=66d12b35-aa92-4dea-8add-8fdf04609371] X-Request-Id:[66d12b35-aa92-4dea-8add-8fdf04609371] Connection:[keep-alive] X-Shopid:[1875180] Content-Language:[en] Cache-Control:[no-cache, no-store] Set-Cookie:[customer_sig=; path=/; expires=Sat, 24 Jan 2037 10:15:39 -0000; HttpOnly _session_id=a26d201e2649179d094c504c0edef003; path=/; HttpOnly cart_sig=; path=/; expires=Tue, 07 Feb 2017 10:15:39 -0000; HttpOnly] X-Content-Type-Options:[nosniff] X-Download-Options:[noopen] Server:[nginx]] 0xc042201060 -1 [chunked] false true map[] 0xc0420ae1e0 <nil>} 

これを行うための正しい方法は何ですか

ているのですか?

答えて

0

URL

x := "https://www.oneness287.com" 
resp, err := http.PostForm(x+"/cart/add",url.Values{"id":{"29709681417"}}) 

ベースでURIを追加それは、私は本当にあなたが別のやったことを見ていけない200 OK

+0

を返します。詳細を教えてください – Krash

+0

今xはURLタイプですか?違いがありましたか? – Krash

+0

@Krash、あなたの例では 'x'の値は? – aerokite

関連する問題