質問

The question is easy. I am requesting:

POST /api/?user=auth HTTP/1.1 Content-Length: 437 Content-Type: multipart/form-data; boundary=tYhL_Uv6shSE9A9DHwvtJvXb0NPSLNMsdg; charset=UTF-8 Host: 192.168.0.10:8888 Connection: Keep-Alive User-Agent: Apache-HttpClient/UNAVAILABLE (java 1.4)

--tYhL_Uv6shSE9A9DHwvtJvXb0NPSLNMsdg Content-Disposition: form-data; name="token"

KJjhyuJHYsadfU78
--tYhL_Uv6shSE9A9DHwvtJvXb0NPSLNMsdg Content-Disposition: form-data; name="api_login"

9053494481
--tYhL_Uv6shSE9A9DHwvtJvXb0NPSLNMsdg Content-Disposition: form-data; name="api_password"

8013468v30
--tYhL_Uv6shSE9A9DHwvtJvXb0NPSLNMsdg Content-Disposition: form-data; name="api_terms"

no
--tYhL_Uv6shSE9A9DHwvtJvXb0NPSLNMsdg--

and receive $_POST === array() in PHP.

PHP 5.3.3 (cli) (built: Dec 11 2013 03:29:57) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with eAccelerator v1.0-dev, Copyright (c) 2004-2012 eAccelerator, by eAccelerator

And

Server version: Apache/2.2.15 (Unix)

Checked the server for rewrite redirects that can lose data - found none. Please, help.

RESOLVED: I used apache library to send multipart request. It produced header:

Content-Type: multipart/form-data; boundary=tYhL_Uv6shSE9A9DHwvtJvXb0NPSLNMsdg; charset=UTF-8

When I remove encoding settings, it changed to:

Content-Type: multipart/form-data; boundary=tYhL_Uv6shSE9A9DHwvtJvXb0NPSLNMsdg

And now all works smooth.

役に立ちましたか?

解決 2

RESOLVED: I used apache library to send multipart request. It produced header:

Content-Type: multipart/form-data; boundary=tYhL_Uv6shSE9A9DHwvtJvXb0NPSLNMsdg; charset=UTF-8

When I remove encoding settings, it changed to:

Content-Type: multipart/form-data; boundary=tYhL_Uv6shSE9A9DHwvtJvXb0NPSLNMsdg

And now all works smooth.

他のヒント

That is a GET method!

Use:

$_GET
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top