我在网络服务中使用了以下代码。
<?php
namespace App\Http\Controllers;
use DrewM\MailChimp\MailChimp;
class ApiController extends Controller
{
public function authenticateApiKey()
{
$mc = new MailChimp('48cda414960152d55f97a8f44e28ea20-us17');
$mailchimp_ping = $mc->get('lists');
return \Illuminate\Support\Facades\Response::json($mailchimp_ping, 200);
}
}
当我提供输入为 using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
namespace StringTest
{
/// <summary>
/// Summary description for StringTest
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
// To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
// [System.Web.Script.Services.ScriptService]
public class StringTest : System.Web.Services.WebService
{
[WebMethod]
public string HelloWorld(string str)
{
return str;
}
}
}
时,我将结果显示为Hello world
(单词之间的两个空格已减少为一个)。我引用了外部Web服务,无法修改方法定义中的任何代码。如何在没有任何数据操作的情况下获得结果?