标签: http-post

提交表格时,Facebook应用程序中没有签名请求?

我正在开发一个Facebook应用程序供页面使用.具有Web表单的页面必不可少,然后通过提交的数据创建数据库记录.没有什么太复杂的了.当我在处理发布数据时尝试区分网站时,会出现复杂性.这就是我所拥有的:

<?php
require_once('../lib/facebook.php');
$facebook = new Facebook(array(
    'appId' => 'xxxxxxxxxxxxxxx',
    'secret' => 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
    'cookie' => true
));
$signed_request = $facebook->getSignedRequest();
switch ($signed_request['page']['id']) {
    case '144778562245193':
        define('SITE_ID', '3');
        define('SITE', 'UK Boxing Events');
        define('DOMAIN', 'ukboxingevents.com');
        define('BODY_CLASS', 'boxing');
    break;
    case '147183265335890':
        define('SITE_ID', '1');
        define('SITE', 'UK Wrestling Events');
        define('DOMAIN', 'ukwrestlingevents.com');
        define('ANALYTICS_ID', 'UA-xxxxxxx-xx');
        define('BODY_CLASS', 'wrestling');
    break;
    case '157856417600021':
        define('SITE_ID', '2');
        define('SITE', 'UK MMA Events');
        define('DOMAIN', 'ukmmaevents.com');
        define('BODY_CLASS', 'mma');
    break;
    default:
        die('Invalid page.');
    break;
}
if (isset($_POST['add_event'])) {
    // submit handler; writes to database
}
?> …
Run Code Online (Sandbox Code Playgroud)

php forms facebook http-post

2
推荐指数
1
解决办法
6067
查看次数

PHP - 拦截POST请求

我想知道是否有人可以帮我解决如何查看$_POST请求.

我想要做的是检查所有$_POST请求,而不仅仅是某些类似的请求,$_POST['name'], $_POST['post']我想查看每个帖子,而无法知道每个POST请求的名称.

这是我尝试过的(片段):

foreach ($_POST as $pst)
{
    echo $pst;
}
//And tried the above for GET too. (but the GET I've manged to working.)
Run Code Online (Sandbox Code Playgroud)

我也试过很多其他人,我可以想到一个可以解决的问题......

php http-post request intercept

2
推荐指数
1
解决办法
2004
查看次数

你能用POST(非javascript)制作跨子域吗?

我找到了很多关于AJAX调用的答案,但是我很难在不使用Javascript的情况下找到一个直接的HTML表单的答案.

您可以从发布的形式foo.mydomain.com/somepage来bar.mydomain.com/someotherpage?

html forms http-post

2
推荐指数
1
解决办法
3440
查看次数

异步HTTP发布android

我正在使用一个应用程序,我只需要从mysql服务器下载谷歌地图的一对坐标.我可以使用PHP和普通的httpost成功完成此操作但我的应用程序冻结了几秒钟,当我这样做.

我读到你需要使httppost asycronous,以避免冻结,直到服务器完成prossess并发送结果.

关键是我需要的结果是像普通的httpost一样的json数组.

例如,如果我有这个httppost.

HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.yoursite.com/script.php");

try {
    // Add your data
    List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
    nameValuePairs.add(new BasicNameValuePair("id", "12345"));
    nameValuePairs.add(new BasicNameValuePair("stringdata", "AndDev is Cool!"));
    httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));

    // Execute HTTP Post Request
    HttpResponse response = httpclient.execute(httppost);
} catch (ClientProtocolException e) {
    // TODO Auto-generated catch block
} catch (IOException e) {
    // TODO Auto-generated catch block
}

String result11 = null;
// convert response to string
try {
    BufferedReader reader = …
Run Code Online (Sandbox Code Playgroud)

android http-post

2
推荐指数
1
解决办法
2万
查看次数

在我的Magento自定义模块的Controller中接收HTTP POST

我正在学习开发模块magento.我正在开发一个支付模块,它应该收到一个帖子(在关闭申请之后)以更改请求的状态并生成发票.

但我不知道如何使用我的HTTP POST控制器.我将在http://mymagento.com/mymodule/receive上发帖.

class MyCompanyName_MyModule_StandardController extends Mage_Core_Controller_Front_Action{

    public function receiveAction() {
        //How receive my POST HERE??
    }

    // ...

}
Run Code Online (Sandbox Code Playgroud)

我感谢任何帮助

http-post magento

2
推荐指数
1
解决办法
2万
查看次数

Java多线程多请求方法

我想向"test.com"发送一个从0到100的请求,我的代码将每秒发送一个请求......这样程序将需要100秒才能完成.

我想要做的是设置10个线程同时运行,使线程1从(0,10); 线程2从(10,20)开始...依此类推,这样程序只需要10秒左右才能完成,这可能吗?怎么能成功呢?

import java.io.InputStreamReader;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.methods.PostMethod;

public class Palomo implements Runnable {
    String url = "http://test.com";
    HttpClient client = null;
    PostMethod method = null;
    BufferedReader br = null;
    String contents = null;

    public void run() {
        for (int i = 0; i <= 100; i++) {
            synchronized (this) {
                doPost(i);
            }
                      try {
        Thread.sleep(1000);
        } catch (InterruptedException e) {
        e.printStackTrace();
        }
        }
    }

    public void doPost(int i) {
        try {
            client = new HttpClient();
            method = new …
Run Code Online (Sandbox Code Playgroud)

java concurrency multithreading http-post

2
推荐指数
1
解决办法
1万
查看次数

我无法在Sinatra发布数据

我在做一些简单的事情时遇到了问题,我不确定我做错了什么.我在Windows下使用最新版本的Ruby和Sinatra(1.9.3和1.3.3)

我的主要代码是:

require 'sinatra'

get '/form' do
  erb :form
end

post '/form' do
    "Value: '#{params[:somevalue]}'"
end
Run Code Online (Sandbox Code Playgroud)

我的再培训局:

<form action="/form" method="post">
    <input type="text" name"somevalue">
    <input type="submit">
</form>
Run Code Online (Sandbox Code Playgroud)

当我按提交时,它不会显示值.它只会显示:Value: ''

我甚至尝试使用纯HTML(结果相同).

这些是我的请求标题:

Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Charset:ISO-8859-1,utf-8;q=0.7,*;q=0.3
Accept-Encoding:gzip,deflate,sdch
Accept-Language:es,en-US;q=0.8,en;q=0.6
Cache-Control:max-age=0
Connection:keep-alive
Content-Length:0
Content-Type:application/x-www-form-urlencoded
Host:localhost:4567
Origin:http://localhost:4567
Referer:http://localhost:4567/form
User-Agent:Mozilla/5.0 (Windows NT 6.2; WOW64) AppleWebKit/537.11 (KHTML, like Gecko)       Chrome/23.0.1271.91 Safari/537.11
Run Code Online (Sandbox Code Playgroud)

我需要配置什么吗?

ruby http-post sinatra

2
推荐指数
1
解决办法
1366
查看次数

如何使用HttpPost发送日文字符

我正在尝试将日文字符发送到我的API服务器,但发送的字符是乱码并且变成了????.所以我使用以下方法将编码设置为实体:

    StringEntity stringEntity = new StringEntity(message, "UTF-8");
Run Code Online (Sandbox Code Playgroud)

但输出成了org.apache.http.entity.StringEntity@4316f850.我想知道是否转换stringEntity为字符串导致了这个,因为我想在我的服务器中发送它String.

这是我如何使用它:

public static String postSendMessage(String path, String message) throws Exception {
    DefaultHttpClient httpClient = new DefaultHttpClient();
    HttpConnectionParams.setConnectionTimeout(httpClient.getParams(), 10000); // Timeout limit
    HttpPost httpPost = new HttpPost(SystemInfo.getApiUrl() + path);
    List<NameValuePair> value = new ArrayList<NameValuePair>();

    StringEntity stringEntity = new StringEntity(message, "UTF-8");
    value.add(new BasicNameValuePair("message", stringEntity.toString())); //Here's where I converted the stringEntity to string

    UrlEncodedFormEntity entity = new UrlEncodedFormEntity(value);
    httpPost.setEntity(entity);
    HttpResponse httpResponse = httpClient.execute(httpPost);

    HttpEntity httpEntity = httpResponse.getEntity(); …
Run Code Online (Sandbox Code Playgroud)

unicode encoding android http-post character-encoding

2
推荐指数
1
解决办法
1192
查看次数

API网关-主体映射模板-可选主体参数

我有一个POST API网关方法,我将向其中发送以下application / json主体,以将参数从其传递到该方法所连接的Lambda:

{ 
    "otherClientId": "12345",
    "message": "Text",
    "seconds": 0,
    "hours": 0
}
Run Code Online (Sandbox Code Playgroud)

我正在使用以下映射模板:

#set($inputRoot = $input.path('$'))
{
  "authorizedUser": "$context.authorizer.principalId",
  "otherClientId": "$inputRoot.otherClientId",
  "message": "$inputRoot.message",
  "amount": $inputRoot.amount,
  "duration": $inputRoot.duration
}
Run Code Online (Sandbox Code Playgroud)

我遇到的问题是,我尝试发送没有数量或持续时间的请求时收到“错误字符串”错误。由于某些原因,这些参数似乎不是可选的(但我需要将它们设为!)。我能够错过其他参数,例如消息,但不能错过两个数字参数。

有人遇到过这种情况吗?或者有人可以指出我很可能会失踪的明显现象吗?AWS文档对此主题很少。

post http-post amazon-web-services aws-lambda aws-api-gateway

2
推荐指数
1
解决办法
1565
查看次数

无法解决以下问题:Lorg / apache / http / client / methods / HttpPost

httpPost在所有8.1及以下版本的android设备上工作,但在android 9.0中运行时出现如下错误,

Failed resolution of: Lorg/apache/http/client/methods/HttpPost;
        at com.makemusiccount.android.retrofit.RestClient.Execute(RestClient.java:99)
        at com.makemusiccount.android.activity.LoginActivity$Login.doInBackground(LoginActivity.java:390)
        at com.makemusiccount.android.activity.LoginActivity$Login.doInBackground(LoginActivity.java:368)
        at android.os.AsyncTask$2.call(AsyncTask.java:333)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:245) 
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) 
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) 
        at java.lang.Thread.run(Thread.java:764) 
     Caused by: java.lang.ClassNotFoundException: Didn't find class "org.apache.http.client.methods.HttpPost" on path: DexPathList[[zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/base.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_dependencies_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_resources_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_0_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_1_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_2_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_3_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_4_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_5_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_6_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_7_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_8_apk.apk", zip file "/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/split_lib_slice_9_apk.apk"],nativeLibraryDirectories=[/data/app/com.makemusiccount.android-HYy0YZQPLivvJM2dD3B3ZA==/lib/x86, /system/lib]]
Run Code Online (Sandbox Code Playgroud)

android http-post retrofit

2
推荐指数
1
解决办法
2987
查看次数